diff --git a/app/build.gradle b/app/build.gradle index d6d8dce25..95db36190 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -274,16 +274,16 @@ dependencies { // Jetpack AndroidX libraries implementation "androidx.palette:palette-ktx:1.0.0" - implementation "androidx.annotation:annotation:1.6.0" + implementation "androidx.annotation:annotation:1.7.1" implementation "androidx.vectordrawable:vectordrawable-animated:1.1.0" implementation "androidx.appcompat:appcompat:1.6.1" - implementation "androidx.recyclerview:recyclerview:1.3.0" - implementation "androidx.core:core-ktx:1.10.1" + implementation "androidx.recyclerview:recyclerview:1.3.2" + implementation "androidx.core:core-ktx:1.12.0" implementation "androidx.constraintlayout:constraintlayout:2.1.4" - implementation "androidx.fragment:fragment-ktx:1.6.0" + implementation "androidx.fragment:fragment-ktx:1.6.2" implementation "androidx.drawerlayout:drawerlayout:1.2.0" - implementation 'androidx.preference:preference-ktx:1.2.0' - implementation 'androidx.webkit:webkit:1.7.0' + implementation 'androidx.preference:preference-ktx:1.2.1' + implementation 'androidx.webkit:webkit:1.10.0' implementation 'androidx.core:core-splashscreen:1.0.1' //def lifecycle_version = "2.4.0" //implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version" diff --git a/app/src/main/java/fulguris/activity/WebBrowserActivity.kt b/app/src/main/java/fulguris/activity/WebBrowserActivity.kt index 6635a0465..b041d7c6d 100644 --- a/app/src/main/java/fulguris/activity/WebBrowserActivity.kt +++ b/app/src/main/java/fulguris/activity/WebBrowserActivity.kt @@ -897,7 +897,11 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(), // Create a gesture detector to catch horizontal swipes our on toolbar val toolbarSwipeDetector = GestureDetectorCompat(this, object : GestureDetector.SimpleOnGestureListener() { - override fun onFling(event1: MotionEvent, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + override fun onFling(event1: MotionEvent?, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + + if (event1==null) { + return false + } // No swipe action when our text field is focused if (searchView.hasFocus()) { @@ -1156,7 +1160,12 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(), // return true // } - override fun onFling(event1: MotionEvent, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + override fun onFling(event1: MotionEvent?, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + + if (event1==null) { + return false + } + // No swipe when too long if ((event2.eventTime - event1.eventTime) > kMaxSwipeTime) { return false diff --git a/app/src/main/java/fulguris/view/ImageView.kt b/app/src/main/java/fulguris/view/ImageView.kt index 8c4cb01ee..1a2c87700 100644 --- a/app/src/main/java/fulguris/view/ImageView.kt +++ b/app/src/main/java/fulguris/view/ImageView.kt @@ -43,7 +43,7 @@ class ImageView : androidx.appcompat.widget.AppCompatImageView { constructor(context: Context): super(context) { } - override fun onDraw(canvas: Canvas?) { + override fun onDraw(canvas: Canvas) { try { super.onDraw(canvas) } catch (e: Exception) { diff --git a/app/src/main/java/fulguris/view/WebPageTab.kt b/app/src/main/java/fulguris/view/WebPageTab.kt index 1ba6b276f..d41d3ab33 100644 --- a/app/src/main/java/fulguris/view/WebPageTab.kt +++ b/app/src/main/java/fulguris/view/WebPageTab.kt @@ -388,7 +388,7 @@ class WebPageTab( /** * */ - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) { when (key) { activity.getString(R.string.pref_key_scrollbar_size) -> { webView?.scrollBarSize = userPreferences.scrollbarSize.px.toInt() @@ -1383,7 +1383,12 @@ class WebPageTab( */ private var canTriggerLongPress = true - override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + override fun onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + + if (e1==null) { + return false + } + val power = (velocityY * 100 / maxFling).toInt() if (power < -10) { webBrowser.hideActionBar() diff --git a/build.gradle b/build.gradle index 5e2acf6ce..f82b9c8fd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlinVersion = '1.8.20' + ext.kotlinVersion = '1.9.20' ext.daggerVersion = '2.46.1' repositories { google() @@ -40,6 +40,6 @@ allprojects { ext { minSdkVersion = 21 - targetSdkVersion = 33 + targetSdkVersion = 34 //buildToolsVersion = '33.0.0' }