From d4cc355cc608251a484a1186ff81157942ea822b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 24 Sep 2024 02:02:30 +0000 Subject: [PATCH 1/6] Update dependency androidx.compose:compose-bom to v2024.09.02 --- 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 e6bd4dc..fd565e7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ appcompat = "1.7.0" billing = "7.1.0" browser = "1.8.0" commonMarkVersion = "0.23.0" -composeBom = "2024.08.00" +composeBom = "2024.09.02" core = "1.6.1" coreKtx = "1.13.1" coreSplashscreen = "1.0.1" -- 2.45.2 From e7f060344617814e75c793cbbd1115264f676975 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 1 Oct 2024 21:16:58 -0600 Subject: [PATCH 2/6] Update HorizontalPager parameters to reflect API changes --- .../main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt index 5cef4d2..72cae5d 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt @@ -4,7 +4,6 @@ import android.content.Intent import android.net.Uri import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -327,7 +326,7 @@ private fun MainScreen( } @Composable -@OptIn(ExperimentalFoundationApi::class, ExperimentalMaterial3Api::class) +@OptIn(ExperimentalMaterial3Api::class) private fun TabbedMarkdownEditor( initialMarkdown: String, markdown: String, @@ -349,7 +348,7 @@ private fun TabbedMarkdownEditor( } HorizontalPager( modifier = Modifier.fillMaxSize(1f), state = pagerState, - beyondBoundsPageCount = 1, + beyondViewportPageCount = 1, userScrollEnabled = !lockSwiping ) { page -> val keyboardController = LocalSoftwareKeyboardController.current -- 2.45.2 From 50c181004f0ff43c938acdd0898814028a1c1545 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 1 Oct 2024 21:17:19 -0600 Subject: [PATCH 3/6] Suppress unchecked cast for PreferenceHelper#observe I know it's not great but it works for now --- .../java/com/wbrawner/simplemarkdown/utility/PreferenceHelper.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/utility/PreferenceHelper.kt b/app/src/main/java/com/wbrawner/simplemarkdown/utility/PreferenceHelper.kt index 633d59f..8820283 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/utility/PreferenceHelper.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/utility/PreferenceHelper.kt @@ -47,6 +47,7 @@ class AndroidPreferenceHelper(context: Context, private val coroutineScope: Coro } } + @Suppress("UNCHECKED_CAST") override fun observe(preference: Preference): StateFlow = states[preference]!!.asStateFlow() as StateFlow } -- 2.45.2 From 2f5a58c1018e45adc0db12cd75713b3e6f1508d3 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 1 Oct 2024 21:17:34 -0600 Subject: [PATCH 4/6] Bump Java version to 11 --- app/build.gradle.kts | 6 +++--- core/build.gradle.kts | 6 +++--- free/build.gradle.kts | 6 +++--- non-free/build.gradle.kts | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8780e82..8dde65b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -37,11 +37,11 @@ android { } compileSdk = libs.versions.maxSdk.get().toInt() compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" } defaultConfig { applicationId = "com.wbrawner.simplemarkdown" diff --git a/core/build.gradle.kts b/core/build.gradle.kts index a50b5a2..bc8e67f 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -41,11 +41,11 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" } lint { disable += listOf("AndroidGradlePluginVersion", "GradleDependency") diff --git a/free/build.gradle.kts b/free/build.gradle.kts index a5b581e..a65414b 100644 --- a/free/build.gradle.kts +++ b/free/build.gradle.kts @@ -27,11 +27,11 @@ android { compose = true } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" } lint { disable += listOf("AndroidGradlePluginVersion", "GradleDependency") diff --git a/non-free/build.gradle.kts b/non-free/build.gradle.kts index 23f5289..5e62253 100644 --- a/non-free/build.gradle.kts +++ b/non-free/build.gradle.kts @@ -24,14 +24,14 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } buildFeatures { compose = true } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" } lint { disable += listOf("AndroidGradlePluginVersion", "GradleDependency") -- 2.45.2 From 64ab2bf345a867f780477729dcfdd9605fa55c64 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 1 Oct 2024 21:19:15 -0600 Subject: [PATCH 5/6] Suppress unchecked cast for FakePreferenceHelper#observe I know it's not great but it works for now --- .../java/com/wbrawner/simplemarkdown/FakePreferenceHelper.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/test/java/com/wbrawner/simplemarkdown/FakePreferenceHelper.kt b/app/src/test/java/com/wbrawner/simplemarkdown/FakePreferenceHelper.kt index a600129..d5b4cd1 100644 --- a/app/src/test/java/com/wbrawner/simplemarkdown/FakePreferenceHelper.kt +++ b/app/src/test/java/com/wbrawner/simplemarkdown/FakePreferenceHelper.kt @@ -23,6 +23,7 @@ class FakePreferenceHelper: PreferenceHelper { preferences[preference] = value } + @Suppress("UNCHECKED_CAST") override fun observe(preference: Preference): StateFlow = preferenceFlow(preference) as StateFlow } \ No newline at end of file -- 2.45.2 From 1ae6f25a4547db6914ece87dc562d4afd5805af1 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 1 Oct 2024 21:19:35 -0600 Subject: [PATCH 6/6] Opt-in to ExperimentalCoroutinesApi for MarkdownViewModelTest --- .../java/com/wbrawner/simplemarkdown/MarkdownViewModelTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/test/java/com/wbrawner/simplemarkdown/MarkdownViewModelTest.kt b/app/src/test/java/com/wbrawner/simplemarkdown/MarkdownViewModelTest.kt index f4e0a88..a360c8d 100644 --- a/app/src/test/java/com/wbrawner/simplemarkdown/MarkdownViewModelTest.kt +++ b/app/src/test/java/com/wbrawner/simplemarkdown/MarkdownViewModelTest.kt @@ -23,6 +23,7 @@ import timber.log.Timber import java.io.File import java.net.URI +@OptIn(ExperimentalCoroutinesApi::class) class MarkdownViewModelTest { private lateinit var fileHelper: FakeFileHelper private lateinit var preferenceHelper: FakePreferenceHelper -- 2.45.2