diff --git a/android-json-form-wizard/build.gradle b/android-json-form-wizard/build.gradle index 04ca23c2a..cc3de8ea4 100644 --- a/android-json-form-wizard/build.gradle +++ b/android-json-form-wizard/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath'com.android.tools.build:gradle:3.5.3' + classpath 'com.android.tools.build:gradle:3.5.3' classpath 'org.apache.commons:commons-lang3:3.7' } } @@ -61,6 +61,10 @@ android { packagingOptions { exclude 'META-INF/DEPENDENCIES' } + + configurations.all { + resolutionStrategy.force 'com.android.support:design:28.0.0' + } } @@ -74,9 +78,10 @@ repositories { } dependencies { - api('org.smartregister:opensrp-client-simprints:1.0.3-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-simprints:1.0.6-SNAPSHOT@aar') { transitive = true exclude group: 'com.android.support', module: 'appcompat-v7' + exclude group: 'com.android.support', module: 'design' } implementation 'com.github.bmelnychuk:atv:1.2.9' implementation('com.android.support:design:28.0.0') { diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/customviews/NumericDatePicker.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/customviews/NumericDatePicker.java index 044d86f96..8ff47a6e2 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/customviews/NumericDatePicker.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/customviews/NumericDatePicker.java @@ -85,8 +85,7 @@ protected void resetDatePicker() { switch (violation) { case MALFORMED_DATE: - // Only Day can malform since different months have different days in the Gregorian calendar - resetPicker(dayPicker, previousDay > 0 ? previousDay : minDay); + resetPicker(dayPicker, getPreviousDay(previousDay, minDay)); break; @@ -588,7 +587,6 @@ private void resetPicker(NumberPicker numberPicker, int value) { numberPicker.setDisplayedValues(null); //set new value - if (value != 0) numberPicker.setValue(value); @@ -656,4 +654,12 @@ private boolean isMaxDayEdge() { private int getMaxDayForSelectedDate() { return NumericDatePickerHelper.getDaysInMonth(getMonth(), NumericDatePickerHelper.isLeapYear(getYear())); } + + private int getPreviousDay(int prevDay, int minDay) { + if (prevDay > 0) { + return getMonth() + 1 == 2 ? Math.min(prevDay, (NumericDatePickerHelper.isLeapYear(getYear()) ? 29 : 28)) : prevDay; + } else { + return minDay; + } + } } diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/DateUtil.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/DateUtil.java index f36f12c5a..941deadf0 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/DateUtil.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/DateUtil.java @@ -43,8 +43,6 @@ public static long getDurationTimeDifference(String date, String endDate) { } public static String getDuration(long timeDiff, Locale locale, Context context) { - - String duration = ""; if (timeDiff >= 0 && timeDiff <= TimeUnit.MILLISECONDS.convert(13, TimeUnit.DAYS)) { diff --git a/build.gradle b/build.gradle index 907def51a..4ca8da437 100644 --- a/build.gradle +++ b/build.gradle @@ -45,8 +45,6 @@ subprojects { jcenter() mavenCentral() maven { url 'https://jitpack.io' } - maven { url "http://nexus.motechproject.org/content/repositories/drishti" } - maven { url "http://nexus.motechproject.org/content/repositories/snapshots" } maven { url "http://acra.googlecode.com/svn/repository/releases" } maven { url "https://repo.maven.apache.org/maven2" } maven { url "http://cloudant.github.io/cloudant-sync-eap/repository" } diff --git a/gradle.properties b/gradle.properties index 55da72196..3a1ce066c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=2.0.10-SNAPSHOT +VERSION_NAME=2.0.11-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard