From 2cad09af8eb2d8edcd798123ca5a45452eacf304 Mon Sep 17 00:00:00 2001 From: ali Date: Wed, 13 Mar 2019 17:50:05 +0330 Subject: [PATCH] fix farvardin on select date crash --- .idea/codeStyles/Project.xml | 29 +++++++++++++++++++ .idea/dictionaries/ali.xml | 11 ------- .idea/gradle.xml | 10 ++----- .idea/misc.xml | 24 --------------- .idea/modules.xml | 1 - .idea/vcs.xml | 2 +- app/build.gradle | 6 ++++ uneversaldatetools/build.gradle | 20 ++++--------- .../datePicker/UDatePicker.java | 13 +++++++-- 9 files changed, 56 insertions(+), 60 deletions(-) create mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/dictionaries/ali.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..30aa626 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dictionaries/ali.xml b/.idea/dictionaries/ali.xml deleted file mode 100644 index 3a50786..0000000 --- a/.idea/dictionaries/ali.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - hijri - jalali - listview - miladi - topbar - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index c6e14ad..2996d53 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -3,15 +3,11 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index fee3a84..b6ea2b1 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,29 +1,5 @@ - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml index bdbcde9..eda2f12 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,7 +3,6 @@ - diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 56cdde1..7a80746 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,6 +28,12 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + lintOptions { + checkReleaseBuilds false + // Or, if you prefer, you can continue to check for errors in release builds, + // but continue the build even when errors are found: + abortOnError false + } } dependencies { diff --git a/uneversaldatetools/build.gradle b/uneversaldatetools/build.gradle index 1681565..5def59e 100644 --- a/uneversaldatetools/build.gradle +++ b/uneversaldatetools/build.gradle @@ -23,22 +23,14 @@ android { } productFlavors { } + lintOptions { + checkReleaseBuilds false + // Or, if you prefer, you can continue to check for errors in release builds, + // but continue the build even when errors are found: + abortOnError false + } } -// for make .jar file -//task deleteJar(type: Delete) { -// delete 'libs/jars/universalDateTools.jar' -//} -// -//task createJar(type: Copy) { -// from('build/intermediates/bundles/release/') -// into('libs/jars/') -// include('classes.jar') -// rename('classes.jar', 'universalDateTools.jar') -//} -// -//createJar.dependsOn(deleteJar, build) - dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') diff --git a/uneversaldatetools/src/main/java/com/ali/uneversaldatetools/datePicker/UDatePicker.java b/uneversaldatetools/src/main/java/com/ali/uneversaldatetools/datePicker/UDatePicker.java index 10fb450..91f8dfa 100644 --- a/uneversaldatetools/src/main/java/com/ali/uneversaldatetools/datePicker/UDatePicker.java +++ b/uneversaldatetools/src/main/java/com/ali/uneversaldatetools/datePicker/UDatePicker.java @@ -355,13 +355,22 @@ public void onDaySelectListener(int day, int monthPos) { //this part is because last and next viewpager views render before scroll try { - ((CalenderViewFragment) mViewPagerAdapter.getItem(mDateSystem.getMonth() - 2)).Render(); + try { + ((CalenderViewFragment) mViewPagerAdapter.getItem(mDateSystem.getMonth() - 2)).Render(); + } catch (RuntimeException e) { + Log.d("something bad happened", e.getMessage()); + } + } catch (ArrayIndexOutOfBoundsException e) { //whe we are in first pos (have no last pos) } try { - ((CalenderViewFragment) mViewPagerAdapter.getItem(mDateSystem.getMonth())).Render(); + try { + ((CalenderViewFragment) mViewPagerAdapter.getItem(mDateSystem.getMonth())).Render(); + } catch (RuntimeException e) { + Log.d("something bad happened", e.getMessage()); + } } catch (IndexOutOfBoundsException e) { //whe we are in last pos (have no next pos) }