From cc9a3deec4431ea27d548423e6ebc5353673ec85 Mon Sep 17 00:00:00 2001 From: dmorozov Date: Wed, 21 Sep 2022 14:10:06 +0300 Subject: [PATCH 1/2] Update project - Update gradle version - Fix gradle issues - Update compileSdkVersion - Update targetSdkVersion - Update buildToolsVersion - Migrate to AndroidX --- build.gradle | 8 +++---- gradle/wrapper/gradle-wrapper.properties | 2 +- sample/build.gradle | 22 ++++++++++--------- sample/src/main/AndroidManifest.xml | 3 ++- vishnu/build.gradle | 15 +++++++------ .../vishnu/implementation/MoveManagerImpl.kt | 10 ++++----- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/build.gradle b/build.gradle index 98d593a..d826a28 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.20' + ext.kotlin_version = '1.7.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong @@ -18,7 +18,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 022ca55..56ea519 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-7.4-bin.zip diff --git a/sample/build.gradle b/sample/build.gradle index c0982c4..7809488 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,14 +1,13 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { applicationId "com.yalantis.sample" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -23,23 +22,26 @@ android { } } + buildFeatures { + viewBinding true + } } repositories { google() - jcenter() + mavenCentral() maven { url 'https://jitpack.io' } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation "androidx.appcompat:appcompat:1.5.1" + implementation "androidx.constraintlayout:constraintlayout:2.1.4" - implementation 'com.github.yalantis:VishnuCalendar:v0.0.1-alpha' + implementation "com.github.yalantis:VishnuCalendar:v0.0.1-alpha" - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + testImplementation "junit:junit:4.13.2" + androidTestImplementation "com.android.support.test:runner:1.0.2" + androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2" } diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 8aab50b..aa0dc23 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -9,7 +9,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + diff --git a/vishnu/build.gradle b/vishnu/build.gradle index 84b410e..0ee9f91 100644 --- a/vishnu/build.gradle +++ b/vishnu/build.gradle @@ -1,14 +1,11 @@ apply plugin: 'com.android.library' - apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' - android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { minSdkVersion 17 - targetSdkVersion 28 + targetSdkVersion 33 versionCode 1 versionName "1.0" } @@ -18,10 +15,14 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + + buildFeatures { + viewBinding true + } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:design:28.0.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "com.google.android.material:material:1.6.1" } diff --git a/vishnu/src/main/java/com/yalantis/vishnu/implementation/MoveManagerImpl.kt b/vishnu/src/main/java/com/yalantis/vishnu/implementation/MoveManagerImpl.kt index 022628a..4f4e6b7 100644 --- a/vishnu/src/main/java/com/yalantis/vishnu/implementation/MoveManagerImpl.kt +++ b/vishnu/src/main/java/com/yalantis/vishnu/implementation/MoveManagerImpl.kt @@ -17,13 +17,13 @@ class MoveManagerImpl(private val viewProvider: ViewProvider) : MoveManager { private var startPoint = EMPTY_FLOAT private val finishListener = object : Animator.AnimatorListener { - override fun onAnimationRepeat(animation: Animator?) {} - override fun onAnimationCancel(animation: Animator?) {} - override fun onAnimationStart(animation: Animator?) { + override fun onAnimationRepeat(animation: Animator) {} + override fun onAnimationCancel(animation: Animator) {} + override fun onAnimationStart(animation: Animator) { isInAction = true } - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationEnd(animation: Animator) { isInAction = false isCollapsed = isCollapsed.not() viewProvider.moveStateChanged(isCollapsed, selectedWeek) @@ -119,7 +119,7 @@ class MoveManagerImpl(private val viewProvider: ViewProvider) : MoveManager { val newHeight = (totalHeight * (touchY / totalHeight)) + dragHeight when { - touchY in topLimit..bottomLimit -> { + touchY in topLimit.toFloat()..bottomLimit.toFloat() -> { performMovement(newHeight, touchY) } touchY > bottomLimit -> { From e588d107bc0e617bb4fc347296a34efc8088c585 Mon Sep 17 00:00:00 2001 From: dmorozov Date: Thu, 22 Sep 2022 13:33:18 +0300 Subject: [PATCH 2/2] Update library version - Update library version - Update README.md --- README.md | 2 +- sample/build.gradle | 4 ++-- vishnu/build.gradle | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 041d1b2..aae22f9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ allprojects { Add the dependency: ```Groovy dependencies { - implementation 'com.github.Yalantis:Kalendar:v0.0.1-alpha' + implementation 'com.github.Yalantis:Kalendar:v0.0.2-alpha' } ``` diff --git a/sample/build.gradle b/sample/build.gradle index 7809488..a9e0f23 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.yalantis.sample" minSdkVersion 21 targetSdkVersion 33 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "1.0.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/vishnu/build.gradle b/vishnu/build.gradle index 0ee9f91..acfac4a 100644 --- a/vishnu/build.gradle +++ b/vishnu/build.gradle @@ -6,8 +6,8 @@ android { defaultConfig { minSdkVersion 17 targetSdkVersion 33 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "1.0.2" } buildTypes { release {