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/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..a9e0f23 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,16 +1,15 @@ 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 - versionCode 1 - versionName "1.0" + targetSdkVersion 33 + versionCode 2 + versionName "1.0.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -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..acfac4a 100644 --- a/vishnu/build.gradle +++ b/vishnu/build.gradle @@ -1,16 +1,13 @@ apply plugin: 'com.android.library' - apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' - android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { minSdkVersion 17 - targetSdkVersion 28 - versionCode 1 - versionName "1.0" + targetSdkVersion 33 + versionCode 2 + versionName "1.0.2" } buildTypes { release { @@ -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 -> {