From fd74a796442fc77909c8abec9fb81ea9ee9425c8 Mon Sep 17 00:00:00 2001 From: Alexander Kolpakov Date: Thu, 27 Feb 2020 15:25:20 +0200 Subject: [PATCH] Update dependencies --- README.md | 2 +- build.gradle | 4 +- demo/build.gradle | 10 +- demo/src/main/AndroidManifest.xml | 1 + .../bitvale/valueprogressdemo/MainActivity.kt | 4 +- demo/src/main/res/layout/activity_main.xml | 127 ++++++++++-------- gradle/wrapper/gradle-wrapper.properties | 2 +- library/build.gradle | 6 +- .../bitvale/valueprogress/ValueProgress.kt | 3 +- 9 files changed, 86 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 38c129e..716c81a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Just add ValueProgress view in your layout XML and ValueProgress library in your ```gradle dependencies { - implementation 'com.bitvale:valueprogress:1.0.0' + implementation 'com.bitvale:valueprogress:1.0.1' } ``` diff --git a/build.gradle b/build.gradle index dc99491..a3c3240 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.0' + ext.kotlin_version = '1.3.61' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.6.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/demo/build.gradle b/demo/build.gradle index 996e222..4fb586d 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -5,13 +5,13 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "com.bitvale.valueprogressdemo" minSdkVersion 16 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 - versionName "1.0" + versionName "1.0.1" } buildTypes { release { @@ -24,7 +24,7 @@ android { dependencies { implementation project(':library') implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.0.2' - implementation 'androidx.core:core-ktx:1.0.1' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.core:core-ktx:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' } diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index a257ba7..8be02f4 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -8,6 +8,7 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" + android:windowSoftInputMode="adjustPan" android:theme="@style/AppTheme.Splash" tools:ignore="GoogleAppIndexingWarning"> diff --git a/demo/src/main/java/com/bitvale/valueprogressdemo/MainActivity.kt b/demo/src/main/java/com/bitvale/valueprogressdemo/MainActivity.kt index 203082d..640d2ab 100644 --- a/demo/src/main/java/com/bitvale/valueprogressdemo/MainActivity.kt +++ b/demo/src/main/java/com/bitvale/valueprogressdemo/MainActivity.kt @@ -27,7 +27,7 @@ class MainActivity : AppCompatActivity() { val text = s.toString() val value = if (text.isNotEmpty()) text.toFloat() else 0f - handler.removeCallbacks(workRunnable) + workRunnable?.let { handler.removeCallbacks(it) } workRunnable = Runnable { progress_percent.percent = value progress_dollar.percent = value / 2 @@ -51,7 +51,7 @@ class MainActivity : AppCompatActivity() { val text = s.toString() val maxValue = if (text.isNotEmpty()) text.toFloat() else 0f - handler.removeCallbacks(workRunnable) + workRunnable?.let { handler.removeCallbacks(it) } workRunnable = Runnable { progress_percent.progressMaxValue = maxValue progress_dollar.progressMaxValue = maxValue diff --git a/demo/src/main/res/layout/activity_main.xml b/demo/src/main/res/layout/activity_main.xml index b5a717e..55dc03f 100644 --- a/demo/src/main/res/layout/activity_main.xml +++ b/demo/src/main/res/layout/activity_main.xml @@ -1,69 +1,80 @@ - - + - + - + - + + + + + + + + + - \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 241d21f..fbd27b9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/library/build.gradle b/library/build.gradle index d2c6fdf..4556759 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -2,13 +2,13 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 16 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 - versionName "1.0" + versionName "1.0.1" } buildTypes { diff --git a/library/src/main/java/com/bitvale/valueprogress/ValueProgress.kt b/library/src/main/java/com/bitvale/valueprogress/ValueProgress.kt index 2da6e1c..b354c59 100644 --- a/library/src/main/java/com/bitvale/valueprogress/ValueProgress.kt +++ b/library/src/main/java/com/bitvale/valueprogress/ValueProgress.kt @@ -12,6 +12,7 @@ import android.text.StaticLayout import android.text.TextPaint import android.util.AttributeSet import android.view.View +import kotlin.math.min /** * Created by Alexander Kolpakov on 11/23/2018 @@ -133,7 +134,7 @@ class ValueProgress @JvmOverloads constructor( override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { super.onSizeChanged(w, h, oldw, oldh) - progressRadius = (Math.min(w, h)) / 2f + progressRadius = (min(w, h)) / 2f progressArc.bottom = progressRadius * 2f progressArc.right = progressRadius * 2f }