diff --git a/app/build.gradle b/app/build.gradle index a17ba724d..cd8c03919 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,13 +5,13 @@ apply plugin: 'kotlin-kapt' android { namespace 'com.kunzisoft.keepass' - compileSdkVersion 32 - buildToolsVersion "32.0.0" + compileSdkVersion 33 + buildToolsVersion "33.0.2" defaultConfig { applicationId "com.kunzisoft.keepass" minSdkVersion 15 - targetSdkVersion 32 + targetSdkVersion 33 versionCode = 120 versionName = "3.5.2" multiDexEnabled true @@ -93,7 +93,7 @@ android { } } -def room_version = "2.4.3" +def room_version = "2.5.1" dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" @@ -102,13 +102,13 @@ dependencies { implementation 'androidx.preference:preference-ktx:1.2.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01' + implementation 'androidx.viewpager2:viewpager2:1.1.0-beta02' implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.biometric:biometric:1.1.0' implementation 'androidx.media:media:1.6.0' // Lifecycle - LiveData - ViewModel - Coroutines implementation "androidx.core:core-ktx:$android_core_version" - implementation 'androidx.fragment:fragment-ktx:1.5.2' + implementation 'androidx.fragment:fragment-ktx:1.6.0' implementation "com.google.android.material:material:$android_material_version" // Token auto complete // From sources until https://github.com/splitwise/TokenAutoComplete/pull/422 fixed diff --git a/app/src/main/java/com/igreenwood/loupe/Loupe.kt b/app/src/main/java/com/igreenwood/loupe/Loupe.kt index 95a1e453f..0fe5177f6 100644 --- a/app/src/main/java/com/igreenwood/loupe/Loupe.kt +++ b/app/src/main/java/com/igreenwood/loupe/Loupe.kt @@ -172,16 +172,16 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, private val onScaleGestureListener: ScaleGestureDetector.OnScaleGestureListener = object : ScaleGestureDetector.OnScaleGestureListener { - override fun onScale(detector: ScaleGestureDetector?): Boolean { + override fun onScale(detector: ScaleGestureDetector): Boolean { if (isDragging() || isBitmapTranslateAnimationRunning || isBitmapScaleAnimationRunninng) { return false } - val scaleFactor = detector?.scaleFactor ?: 1.0f - val focalX = detector?.focusX ?: bitmapBounds.centerX() - val focalY = detector?.focusY ?: bitmapBounds.centerY() + val scaleFactor = detector.scaleFactor + val focalX = detector.focusX + val focalY = detector.focusY - if (detector?.scaleFactor == 1.0f) { + if (detector.scaleFactor == 1.0f) { // scale is not changing return true } @@ -191,22 +191,23 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, return true } - override fun onScaleBegin(p0: ScaleGestureDetector?): Boolean = true + override fun onScaleBegin(p0: ScaleGestureDetector): Boolean = true + + override fun onScaleEnd(p0: ScaleGestureDetector) {} - override fun onScaleEnd(p0: ScaleGestureDetector?) {} } private val onGestureListener: GestureDetector.OnGestureListener = object : GestureDetector.SimpleOnGestureListener() { - override fun onDown(e: MotionEvent?): Boolean = true + override fun onDown(e: MotionEvent): Boolean = true override fun onScroll( - e1: MotionEvent?, - e2: MotionEvent?, - distanceX: Float, - distanceY: Float + e1: MotionEvent, + e2: MotionEvent, + distanceX: Float, + distanceY: Float ): Boolean { - if (e2?.pointerCount != 1) { + if (e2.pointerCount != 1) { return true } @@ -219,13 +220,11 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, } override fun onFling( - e1: MotionEvent?, - e2: MotionEvent?, - velocityX: Float, - velocityY: Float + e1: MotionEvent, + e2: MotionEvent, + velocityX: Float, + velocityY: Float ): Boolean { - e1 ?: return true - if (scale > minScale) { processFlingBitmap(velocityX, velocityY) } else { @@ -234,9 +233,7 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, return true } - override fun onDoubleTap(e: MotionEvent?): Boolean { - e ?: return false - + override fun onDoubleTap(e: MotionEvent): Boolean { if (isBitmapScaleAnimationRunninng) { return true } @@ -376,21 +373,21 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, onViewTranslateListener?.onViewTranslate(imageView, amount) } .setListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { isViewTranslateAnimationRunning = false onViewTranslateListener?.onDismiss(imageView) cleanup() } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { isViewTranslateAnimationRunning = false } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) @@ -409,21 +406,21 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, onViewTranslateListener?.onViewTranslate(imageView, amount) } addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { // no op } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { isViewTranslateAnimationRunning = false onViewTranslateListener?.onDismiss(imageView) cleanup() } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { isViewTranslateAnimationRunning = false } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) @@ -480,20 +477,20 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, setTransform() } addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { isBitmapTranslateAnimationRunning = true } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { isBitmapTranslateAnimationRunning = false constrainBitmapBounds() } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { isBitmapTranslateAnimationRunning = false } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) @@ -531,11 +528,11 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, setTransform() } addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { isBitmapScaleAnimationRunninng = true } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { isBitmapScaleAnimationRunninng = false if (endScale == minScale) { zoomToTargetScale(minScale, focalX, focalY) @@ -543,11 +540,11 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, } } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { isBitmapScaleAnimationRunninng = false } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) @@ -585,11 +582,11 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, setTransform() } addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { isBitmapScaleAnimationRunninng = true } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { isBitmapScaleAnimationRunninng = false if (endScale == minScale) { scale = minScale @@ -599,11 +596,11 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, } } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { isBitmapScaleAnimationRunninng = false } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) @@ -669,19 +666,19 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, onViewTranslateListener?.onViewTranslate(this, amount) } .setListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { // no op } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { onViewTranslateListener?.onRestore(imageView) } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { // no op } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) @@ -696,19 +693,19 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, onViewTranslateListener?.onViewTranslate(imageView, amount) } addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { // no op } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { onViewTranslateListener?.onRestore(imageView) } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { // no op } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) @@ -737,27 +734,27 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, onViewTranslateListener?.onViewTranslate(this, amount) } .setListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { isViewTranslateAnimationRunning = true } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { isViewTranslateAnimationRunning = false onViewTranslateListener?.onDismiss(imageView) cleanup() } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { isViewTranslateAnimationRunning = false } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) } } else { - ObjectAnimator.ofFloat(imageView, View.TRANSLATION_Y, imageView.translationY.toFloat()).apply { + ObjectAnimator.ofFloat(imageView, View.TRANSLATION_Y, imageView.translationY).apply { duration = dismissAnimationDuration interpolator = AccelerateDecelerateInterpolator() addUpdateListener { @@ -766,21 +763,21 @@ class Loupe(imageView: ImageView, container: ViewGroup) : View.OnTouchListener, onViewTranslateListener?.onViewTranslate(imageView, amount) } addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { + override fun onAnimationStart(p0: Animator) { isViewTranslateAnimationRunning = true } - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationEnd(p0: Animator) { isViewTranslateAnimationRunning = false onViewTranslateListener?.onDismiss(imageView) cleanup() } - override fun onAnimationCancel(p0: Animator?) { + override fun onAnimationCancel(p0: Animator) { isViewTranslateAnimationRunning = false } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator) { // no op } }) diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt b/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt index f95a22e70..0e451ad32 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt @@ -200,7 +200,7 @@ class GroupActivity : DatabaseLockActivity(), } } private val mOnSearchActionExpandListener = object : MenuItem.OnActionExpandListener { - override fun onMenuItemActionExpand(p0: MenuItem?): Boolean { + override fun onMenuItemActionExpand(p0: MenuItem): Boolean { searchFiltersView?.visibility = View.VISIBLE searchView?.setOnQueryTextListener(mOnSearchQueryTextListener) searchFiltersView?.onParametersChangeListener = mOnSearchFiltersChangeListener @@ -215,7 +215,7 @@ class GroupActivity : DatabaseLockActivity(), return true } - override fun onMenuItemActionCollapse(p0: MenuItem?): Boolean { + override fun onMenuItemActionCollapse(p0: MenuItem): Boolean { searchFiltersView?.onParametersChangeListener = null searchView?.setOnQueryTextListener(null) searchFiltersView?.visibility = View.GONE diff --git a/app/src/main/java/com/kunzisoft/keepass/view/ViewUtil.kt b/app/src/main/java/com/kunzisoft/keepass/view/ViewUtil.kt index 8c9b021d3..f5ad2e75d 100644 --- a/app/src/main/java/com/kunzisoft/keepass/view/ViewUtil.kt +++ b/app/src/main/java/com/kunzisoft/keepass/view/ViewUtil.kt @@ -122,15 +122,15 @@ fun View.collapse(animate: Boolean = true, play(slideAnimator) interpolator = AccelerateDecelerateInterpolator() addListener(object: Animator.AnimatorListener { - override fun onAnimationStart(animation: Animator?) { + override fun onAnimationStart(animation: Animator) { } - override fun onAnimationRepeat(animation: Animator?) {} - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationRepeat(animation: Animator) {} + override fun onAnimationEnd(animation: Animator) { visibility = View.GONE layoutParams.height = recordViewHeight onCollapseFinished?.invoke() } - override fun onAnimationCancel(animation: Animator?) {} + override fun onAnimationCancel(animation: Animator) {} }) }.start() } @@ -156,12 +156,12 @@ fun View.expand(animate: Boolean = true, play(slideAnimator) interpolator = AccelerateDecelerateInterpolator() addListener(object: Animator.AnimatorListener { - override fun onAnimationStart(animation: Animator?) {} - override fun onAnimationRepeat(animation: Animator?) {} - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationStart(animation: Animator) {} + override fun onAnimationRepeat(animation: Animator) {} + override fun onAnimationEnd(animation: Animator) { onExpandFinished?.invoke() } - override fun onAnimationCancel(animation: Animator?) {} + override fun onAnimationCancel(animation: Animator) {} }) }.start() } @@ -191,12 +191,12 @@ fun View.hideByFading() { .alpha(0f) .setDuration(140) .setListener(object: Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) {} - override fun onAnimationEnd(p0: Animator?) { + override fun onAnimationStart(p0: Animator) {} + override fun onAnimationEnd(p0: Animator) { isVisible = false } - override fun onAnimationCancel(p0: Animator?) {} - override fun onAnimationRepeat(p0: Animator?) {} + override fun onAnimationCancel(p0: Animator) {} + override fun onAnimationRepeat(p0: Animator) {} }) } diff --git a/build.gradle b/build.gradle index daa60fce8..80b4e9176 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.7.10' - ext.android_core_version = '1.8.0' - ext.android_appcompat_version = '1.5.0' - ext.android_material_version = '1.6.1' - ext.android_test_version = '1.4.0' + ext.kotlin_version = '1.8.20' + ext.android_core_version = '1.10.1' + ext.android_appcompat_version = '1.6.1' + ext.android_material_version = '1.9.0' + ext.android_test_version = '1.5.2' repositories { mavenCentral() google() diff --git a/crypto/build.gradle b/crypto/build.gradle index 424fb77e4..1ddf5a873 100644 --- a/crypto/build.gradle +++ b/crypto/build.gradle @@ -5,13 +5,13 @@ plugins { android { namespace 'com.kunzisoft.encrypt' - compileSdkVersion 32 - buildToolsVersion "32.0.0" + compileSdkVersion 33 + buildToolsVersion "33.0.2" ndkVersion "21.4.7075529" defaultConfig { minSdkVersion 15 - targetSdkVersion 32 + targetSdkVersion 33 multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/database/build.gradle b/database/build.gradle index fa8c3b4ec..c1094d041 100644 --- a/database/build.gradle +++ b/database/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android' android { namespace 'com.kunzisoft.keepass.database' - compileSdkVersion 32 - buildToolsVersion "32.0.0" + compileSdkVersion 33 + buildToolsVersion "33.0.2" defaultConfig { minSdkVersion 15 - targetSdk 32 + targetSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" diff --git a/icon-pack/build.gradle b/icon-pack/build.gradle index ddd6b255a..5ae83a35f 100644 --- a/icon-pack/build.gradle +++ b/icon-pack/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android' android { namespace 'com.kunzisoft.keepass.icon' - compileSdkVersion 32 - buildToolsVersion '32.0.0' + compileSdkVersion 33 + buildToolsVersion '33.0.2' defaultConfig { minSdkVersion 14 - targetSdkVersion 32 + targetSdkVersion 33 } } diff --git a/icon-pack/classic/build.gradle b/icon-pack/classic/build.gradle index ad9871d95..24d79b865 100644 --- a/icon-pack/classic/build.gradle +++ b/icon-pack/classic/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.library' android { namespace 'com.kunzisoft.keepass.icon.classic' - compileSdkVersion 32 - buildToolsVersion '32.0.0' + compileSdkVersion 33 + buildToolsVersion '33.0.2' defaultConfig { minSdkVersion 14 - targetSdkVersion 32 + targetSdkVersion 33 } resourcePrefix 'classic_' diff --git a/icon-pack/material/build.gradle b/icon-pack/material/build.gradle index 2fa4b74f1..ada0c8d61 100644 --- a/icon-pack/material/build.gradle +++ b/icon-pack/material/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.library' android { namespace 'com.kunzisoft.keepass.icon.material' - compileSdkVersion 32 - buildToolsVersion '32.0.0' + compileSdkVersion 33 + buildToolsVersion '33.0.2' defaultConfig { minSdkVersion 14 - targetSdkVersion 32 + targetSdkVersion 33 } resourcePrefix 'material_'