From a8f43e1265e4d3b4193d32478f779582d682aec7 Mon Sep 17 00:00:00 2001 From: Jan Skrasek Date: Sun, 14 Aug 2022 19:20:39 +0200 Subject: [PATCH 1/3] update to compileSdk 33 --- build.gradle.kts | 10 ---------- catalog/build.gradle.kts | 2 +- .../main/java/kiwi/orbit/compose/catalog/AppTheme.kt | 3 +++ gradle/libs.versions.toml | 3 ++- settings.gradle.kts | 8 ++++++++ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e9a6445ae..ee175bbfd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,17 +27,7 @@ buildscript { } } -repositories { - mavenCentral() -} - subprojects { - repositories { - google() - mavenCentral() - maven { url = uri("https://kotlin.bintray.com/kotlinx/") } - } - tasks.withType().configureEach { kotlinOptions { jvmTarget = "1.8" diff --git a/catalog/build.gradle.kts b/catalog/build.gradle.kts index fcaebe064..b7cf6d1f0 100644 --- a/catalog/build.gradle.kts +++ b/catalog/build.gradle.kts @@ -17,7 +17,7 @@ android { defaultConfig { applicationId = "kiwi.orbit.compose.catalog" minSdk = libs.versions.minSdk.get().toInt() - targetSdk = 33 + targetSdk = libs.versions.targetSdk.get().toInt() versionName = project.findProperty("VERSION_NAME").toString() val bits = versionName!!.split('.').map { it.toInt() } diff --git a/catalog/src/main/java/kiwi/orbit/compose/catalog/AppTheme.kt b/catalog/src/main/java/kiwi/orbit/compose/catalog/AppTheme.kt index db45a67d0..3141f3123 100644 --- a/catalog/src/main/java/kiwi/orbit/compose/catalog/AppTheme.kt +++ b/catalog/src/main/java/kiwi/orbit/compose/catalog/AppTheme.kt @@ -1,5 +1,6 @@ package kiwi.orbit.compose.catalog +import android.annotation.SuppressLint import android.content.Context import androidx.compose.runtime.Composable import androidx.compose.runtime.remember @@ -30,9 +31,11 @@ fun AppTheme( } } +@SuppressLint("DiscouragedApi") private fun createFontFamily(context: Context): FontFamily { val resources = context.resources val packageName = context.packageName + val book = resources.getIdentifier("circular_pro_book", "font", packageName) val medium = resources.getIdentifier("circular_pro_medium", "font", packageName) val bold = resources.getIdentifier("circular_pro_bold", "font", packageName) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 772326524..1da2e0c90 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,7 @@ [versions] -compileSdk = "32" +compileSdk = "33" +targetSdk = "33" minSdk = "23" kotlin-lang = "1.7.10" diff --git a/settings.gradle.kts b/settings.gradle.kts index 3284dce73..a108d16f1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,6 +22,14 @@ pluginManagement { } } +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + maven { url = uri("https://kotlin.bintray.com/kotlinx/") } + } +} + include(":catalog") include(":ui") include(":icons") From 7513972eb944b6a8d01b001f059a17ee4cc3d1db Mon Sep 17 00:00:00 2001 From: Jan Skrasek Date: Sun, 14 Aug 2022 19:21:23 +0200 Subject: [PATCH 2/3] use predictive back gesture in catalog --- catalog/build.gradle.kts | 1 + catalog/src/main/AndroidManifest.xml | 7 +++++-- gradle/libs.versions.toml | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/catalog/build.gradle.kts b/catalog/build.gradle.kts index b7cf6d1f0..56ab8cf4c 100644 --- a/catalog/build.gradle.kts +++ b/catalog/build.gradle.kts @@ -93,6 +93,7 @@ dependencies { implementation(libs.androidx.core) implementation(libs.androidx.activityCompose) + implementation(libs.androidx.activityComposeCatalog) implementation(libs.compose.animation) implementation(libs.compose.foundation) diff --git a/catalog/src/main/AndroidManifest.xml b/catalog/src/main/AndroidManifest.xml index a66e5e09d..f835e843d 100644 --- a/catalog/src/main/AndroidManifest.xml +++ b/catalog/src/main/AndroidManifest.xml @@ -1,14 +1,17 @@ - + + android:theme="@style/Theme.Catalog" + tools:ignore="UnusedAttribute"> Date: Thu, 29 Sep 2022 12:15:53 +0200 Subject: [PATCH 3/3] update Paparazzi to work on SDK 32 --- ui/src/test/kotlin/ScreenshotTest.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/src/test/kotlin/ScreenshotTest.kt b/ui/src/test/kotlin/ScreenshotTest.kt index 4af17daff..5608d265a 100644 --- a/ui/src/test/kotlin/ScreenshotTest.kt +++ b/ui/src/test/kotlin/ScreenshotTest.kt @@ -11,6 +11,8 @@ import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.unit.dp import app.cash.paparazzi.DeviceConfig.Companion.PIXEL_5 import app.cash.paparazzi.Paparazzi +import app.cash.paparazzi.androidHome +import app.cash.paparazzi.detectEnvironment import com.android.ide.common.rendering.api.SessionParams import com.android.resources.NightMode import kiwi.orbit.compose.ui.controls.AlertCriticalPreview @@ -66,22 +68,24 @@ internal class ScreenshotTest { @get:Rule val paparazzi = Paparazzi( theme = "android:Theme.Material.NoActionBar.Fullscreen", + renderingMode = SessionParams.RenderingMode.V_SCROLL, + environment = detectEnvironment().copy( + platformDir = "${androidHome()}/platforms/android-32", + compileSdkVersion = 32, + ), ) private fun snapshot(content: @Composable () -> Unit) { paparazzi.unsafeUpdateConfig( deviceConfig = PIXEL_5.copy(screenHeight = 1, softButtons = false), - renderingMode = SessionParams.RenderingMode.V_SCROLL, ) paparazzi.snapshot { content() } paparazzi.unsafeUpdateConfig( deviceConfig = PIXEL_5.copy(screenHeight = 1, softButtons = false, fontScale = 1.6f), - renderingMode = SessionParams.RenderingMode.V_SCROLL, ) paparazzi.snapshot(name = "big") { content() } paparazzi.unsafeUpdateConfig( deviceConfig = PIXEL_5.copy(screenHeight = 1, softButtons = false, nightMode = NightMode.NIGHT), - renderingMode = SessionParams.RenderingMode.V_SCROLL, ) paparazzi.snapshot(name = "dark") { // Workaround for https://github.com/cashapp/paparazzi/pull/473