From a569a50b5697c05c90e5732b3a3924cfad4d86ad Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Fri, 13 Oct 2023 16:53:13 +0200 Subject: [PATCH 1/3] Compile with SDK 34 (Android 14) --- .../seriesguide/preferences/SgPreferencesFragment.kt | 5 ++++- .../java/com/battlelancer/seriesguide/shows/ShowsFragment.kt | 2 +- build.gradle.kts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/battlelancer/seriesguide/preferences/SgPreferencesFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/preferences/SgPreferencesFragment.kt index c2ac35c3af..7ebca193de 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/preferences/SgPreferencesFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/preferences/SgPreferencesFragment.kt @@ -403,7 +403,10 @@ class SgPreferencesFragment : BasePreferencesFragment(), super.onActivityResult(requestCode, resultCode, data) } - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { + if (key == null) { + return // Preferences were cleared, do nothing. + } val pref: Preference? = findPreference(key) if (pref != null) { BackupManager(pref.context).dataChanged() diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt index 77997a147e..3b53b88143 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt @@ -368,7 +368,7 @@ class ShowsFragment : Fragment() { } private val onPreferenceChangeListener = - OnSharedPreferenceChangeListener { _: SharedPreferences?, key: String -> + OnSharedPreferenceChangeListener { _: SharedPreferences?, key: String? -> if (key == AdvancedSettings.KEY_UPCOMING_LIMIT) { updateShowsQuery() // refresh all list widgets diff --git a/build.gradle.kts b/build.gradle.kts index 72322b6091..f8a2ddfc94 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { } buildscript { - val sgCompileSdk by extra(33) // Android 13 (T) + val sgCompileSdk by extra(34) // Android 14 (U) val sgMinSdk by extra(21) // Android 5 (L) val sgTargetSdk by extra(33) // Android 13 (T) From 19069604c7648cb654576c006ac55b017b1dab86 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Fri, 13 Oct 2023 16:57:23 +0200 Subject: [PATCH 2/3] Update Android Plugin [8.1.0 -> 8.1.2] --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8c6664f22a..31214324d6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -103,7 +103,7 @@ truth = "com.google.truth:truth:1.1.5" # https://github.com/google/truth/release [plugins] # https://developer.android.com/build/releases/gradle-plugin -android = { id = "com.android.application", version = "8.1.0" } +android = { id = "com.android.application", version = "8.1.2" } # https://kotlinlang.org/docs/releases.html#release-details kotlin = { id = "org.jetbrains.kotlin.android", version = "1.8.22" } # https://github.com/ben-manes/gradle-versions-plugin/releases From b2c26c70f0fbdfac668f2a021794fd77f6145f4f Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Wed, 18 Oct 2023 16:20:54 +0200 Subject: [PATCH 3/3] Ignore overridePendingTransition deprecation. My bet is that it will never be removed as it's just deprecated for predictive back which is unlikely to be adopted. --- .../java/com/battlelancer/seriesguide/shows/ShowsFragment.kt | 1 + .../java/com/battlelancer/seriesguide/ui/BaseTopActivity.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt index 3b53b88143..0d01c3486b 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt @@ -333,6 +333,7 @@ class ShowsFragment : Fragment() { override fun onSignInClicked() { startActivity(Intent(requireActivity(), MoreOptionsActivity::class.java)) // Launching a top activity, adjust animation to match. + @Suppress("DEPRECATION") // just deprecated for predictive back requireActivity().overridePendingTransition( R.anim.activity_fade_enter_sg, R.anim.activity_fade_exit_sg ) diff --git a/app/src/main/java/com/battlelancer/seriesguide/ui/BaseTopActivity.kt b/app/src/main/java/com/battlelancer/seriesguide/ui/BaseTopActivity.kt index 9c6ffc9508..8be945a8cb 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/ui/BaseTopActivity.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/ui/BaseTopActivity.kt @@ -54,6 +54,7 @@ abstract class BaseTopActivity : BaseMessageActivity() { // Use a custom animation when navigating away from a top activity // but not when exiting the app (use the default system animations). if (!isTaskRoot) { + @Suppress("DEPRECATION") // just deprecated for predictive back overridePendingTransition( R.anim.activity_fade_enter_sg, R.anim.activity_fade_exit_sg @@ -126,6 +127,7 @@ abstract class BaseTopActivity : BaseMessageActivity() { } if (launchIntent != null) { startActivity(launchIntent) + @Suppress("DEPRECATION") // just deprecated for predictive back overridePendingTransition(R.anim.activity_fade_enter_sg, R.anim.activity_fade_exit_sg) } }