diff --git a/app/build.gradle b/app/build.gradle index 0849fd1..ad48b22 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '25.0.2' + compileSdkVersion 28 + buildToolsVersion '27.0.3' defaultConfig { applicationId "cn.iwgang.countdownviewdemo" minSdkVersion 15 - targetSdkVersion 23 + targetSdkVersion 28 versionCode 1 versionName "1.0" } @@ -21,9 +21,10 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:23.3.0' + //noinspection GradleCompatible + implementation 'com.android.support:appcompat-v7:27.0.0' compile 'com.github.iwgang:familiarrecyclerview:1.3.0' compile 'cn.qqtheme.framework:ColorPicker:1.1.3' -// compile project(':library') - compile 'com.github.iwgang:countdownview:2.1.6' + compile project(':library') + // compile 'com.github.iwgang:countdownview:2.1.6' } diff --git a/build.gradle b/build.gradle index 3cf5f30..03e0efb 100644 --- a/build.gradle +++ b/build.gradle @@ -2,9 +2,10 @@ buildscript { repositories { jcenter() + maven { url 'https://maven.google.com/'} } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.6.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -13,5 +14,6 @@ buildscript { allprojects { repositories { jcenter() + maven { url 'https://maven.google.com/'} } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0c71e76..40bb4ea 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Fri Dec 11 15:46:33 CST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip diff --git a/library/build.gradle b/library/build.gradle index aff5590..75fa012 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 21 + compileSdkVersion 28 buildToolsVersion '25.0.2' defaultConfig { minSdkVersion 10 - targetSdkVersion 21 + targetSdkVersion 28 versionCode 1 versionName "1.0" } diff --git a/library/src/main/java/cn/iwgang/countdownview/BaseCountdown.java b/library/src/main/java/cn/iwgang/countdownview/BaseCountdown.java index d26533e..0c5ee1d 100644 --- a/library/src/main/java/cn/iwgang/countdownview/BaseCountdown.java +++ b/library/src/main/java/cn/iwgang/countdownview/BaseCountdown.java @@ -27,6 +27,7 @@ class BaseCountdown { protected String mSuffix, mSuffixDay, mSuffixHour, mSuffixMinute, mSuffixSecond, mSuffixMillisecond; protected float mSuffixDayTextWidth, mSuffixHourTextWidth, mSuffixMinuteTextWidth, mSuffixSecondTextWidth, mSuffixMillisecondTextWidth; protected boolean isDayLargeNinetyNine; + protected boolean isHourLargeNinetyNine; protected Paint mTimeTextPaint, mSuffixTextPaint, mMeasureHourWidthPaint; protected float mLeftPaddingSize; protected float mSuffixDayLeftMargin, mSuffixDayRightMargin; @@ -730,6 +731,21 @@ public boolean handlerDayLargeNinetyNine() { return isReLayout; } + public boolean handlerHourLargeNinetyNine() { + boolean isReLayout = false; + if (isShowHour && isConvertDaysToHours) { + // handler large ninety nine + if (!isHourLargeNinetyNine && mHour > 99) { + isHourLargeNinetyNine = true; + isReLayout = true; + } else if (isHourLargeNinetyNine && mHour <= 99) { + isHourLargeNinetyNine = false; + isReLayout = true; + } + } + return isReLayout; + } + public void setTimes(int day, int hour, int minute, int second, int millisecond) { mDay = day; mHour = hour; diff --git a/library/src/main/java/cn/iwgang/countdownview/CountdownView.java b/library/src/main/java/cn/iwgang/countdownview/CountdownView.java index 097df58..ceb0e71 100644 --- a/library/src/main/java/cn/iwgang/countdownview/CountdownView.java +++ b/library/src/main/java/cn/iwgang/countdownview/CountdownView.java @@ -268,7 +268,8 @@ public void updateShow(long ms) { } } - if (mCountdown.handlerAutoShowTime() || mCountdown.handlerDayLargeNinetyNine()) { + if (mCountdown.handlerAutoShowTime() || mCountdown.handlerDayLargeNinetyNine() + || mCountdown.handlerHourLargeNinetyNine()) { reLayout(); } else { invalidate();