Skip to content

Commit

Permalink
Switch to SDK 34
Browse files Browse the repository at this point in the history
Upgrade Kotlin and a bunch of dependencies.
Switch to latest Webkit.
  • Loading branch information
Slion committed Mar 24, 2024
1 parent 0a51694 commit a2b289d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 11 additions & 2 deletions app/src/main/java/fulguris/activity/WebBrowserActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/fulguris/view/ImageView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/fulguris/view/WebPageTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.8.20'
ext.kotlinVersion = '1.9.20'
ext.daggerVersion = '2.46.1'
repositories {
google()
Expand Down Expand Up @@ -40,6 +40,6 @@ allprojects {

ext {
minSdkVersion = 21
targetSdkVersion = 33
targetSdkVersion = 34
//buildToolsVersion = '33.0.0'
}

0 comments on commit a2b289d

Please sign in to comment.