From c6ca28751b2510852f745b65386d9e00d452b44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Tue, 2 Apr 2024 10:10:58 +0200 Subject: [PATCH 1/9] Fix AppTest due to missing dependency --- Jetsnack/app/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/Jetsnack/app/build.gradle.kts b/Jetsnack/app/build.gradle.kts index 06b1280815..aa1910385a 100644 --- a/Jetsnack/app/build.gradle.kts +++ b/Jetsnack/app/build.gradle.kts @@ -121,4 +121,5 @@ dependencies { androidTestImplementation(libs.androidx.test.ext.junit) androidTestImplementation(libs.kotlinx.coroutines.test) androidTestImplementation(libs.androidx.compose.ui.test) + androidTestImplementation(libs.androidx.compose.ui.test.junit4) } From 8fa3515f81aadd95b5ce9423a1c6f382ae8c442e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Tue, 2 Apr 2024 10:14:17 +0200 Subject: [PATCH 2/9] Fix setting content --- .../src/androidTest/java/com/example/jetsnack/AppTest.kt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt b/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt index 0a869527ef..978f05c81d 100644 --- a/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt +++ b/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt @@ -31,13 +31,6 @@ class AppTest { @get:Rule val composeTestRule = createAndroidComposeRule() - @Before - fun setUp() { - composeTestRule.setContent { - JetsnackApp() - } - } - @Test fun app_launches() { // Check app launches at the correct destination From 7b09866749ca440fb3637f5a4b3eedf2fc552d05 Mon Sep 17 00:00:00 2001 From: mlykotom Date: Tue, 2 Apr 2024 08:16:36 +0000 Subject: [PATCH 3/9] =?UTF-8?q?=F0=9F=A4=96=20Apply=20Spotless?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/src/androidTest/java/com/example/jetsnack/AppTest.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt b/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt index 978f05c81d..646a3d6a4f 100644 --- a/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt +++ b/Jetsnack/app/src/androidTest/java/com/example/jetsnack/AppTest.kt @@ -20,9 +20,7 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createAndroidComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick -import com.example.jetsnack.ui.JetsnackApp import com.example.jetsnack.ui.MainActivity -import org.junit.Before import org.junit.Rule import org.junit.Test From 30357027e58d7b9dbd044fa9c62d16e586a6337b Mon Sep 17 00:00:00 2001 From: compose-devrel-github-bot Date: Fri, 5 Apr 2024 16:59:28 +0000 Subject: [PATCH 4/9] =?UTF-8?q?=F0=9F=A4=96=20Update=20Dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Crane/gradle/libs.versions.toml | 8 ++++---- JetLagged/gradle/libs.versions.toml | 8 ++++---- JetNews/gradle/libs.versions.toml | 8 ++++---- Jetcaster/gradle/libs.versions.toml | 8 ++++---- Jetchat/gradle/libs.versions.toml | 8 ++++---- Jetsnack/gradle/libs.versions.toml | 8 ++++---- Jetsurvey/gradle/libs.versions.toml | 8 ++++---- Owl/gradle/libs.versions.toml | 8 ++++---- Reply/gradle/libs.versions.toml | 8 ++++---- scripts/libs.versions.toml | 8 ++++---- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Crane/gradle/libs.versions.toml b/Crane/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/Crane/gradle/libs.versions.toml +++ b/Crane/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/JetLagged/gradle/libs.versions.toml b/JetLagged/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/JetLagged/gradle/libs.versions.toml +++ b/JetLagged/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/JetNews/gradle/libs.versions.toml b/JetNews/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/JetNews/gradle/libs.versions.toml +++ b/JetNews/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/Jetcaster/gradle/libs.versions.toml b/Jetcaster/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/Jetcaster/gradle/libs.versions.toml +++ b/Jetcaster/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/Jetchat/gradle/libs.versions.toml b/Jetchat/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/Jetchat/gradle/libs.versions.toml +++ b/Jetchat/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/Jetsnack/gradle/libs.versions.toml b/Jetsnack/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/Jetsnack/gradle/libs.versions.toml +++ b/Jetsnack/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/Jetsurvey/gradle/libs.versions.toml b/Jetsurvey/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/Jetsurvey/gradle/libs.versions.toml +++ b/Jetsurvey/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/Owl/gradle/libs.versions.toml b/Owl/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/Owl/gradle/libs.versions.toml +++ b/Owl/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/Reply/gradle/libs.versions.toml b/Reply/gradle/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/Reply/gradle/libs.versions.toml +++ b/Reply/gradle/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" diff --git a/scripts/libs.versions.toml b/scripts/libs.versions.toml index b64620cd5c..4231a34163 100644 --- a/scripts/libs.versions.toml +++ b/scripts/libs.versions.toml @@ -9,9 +9,9 @@ androidx-activity-compose = "1.8.2" androidx-appcompat = "1.6.1" androidx-benchmark = "1.2.0" androidx-benchmark-junit4 = "1.2.1" -androidx-compose-bom = "2024.03.00" +androidx-compose-bom = "2024.04.00" androidx-constraintlayout = "1.0.1" -androidx-corektx = "1.13.0-beta01" +androidx-corektx = "1.13.0-rc01" androidx-glance = "1.0.0" androidx-lifecycle-compose = "2.7.0" androidx-lifecycle-runtime-compose = "2.7.0" @@ -21,7 +21,7 @@ androidx-test = "1.5.0" androidx-test-espresso = "3.5.1" androidx-test-ext-junit = "1.1.5" androidx-test-ext-truth = "1.5.0" -androidx-window = "1.3.0-alpha03" +androidx-window = "1.3.0-beta01" androidxHiltNavigationCompose = "1.1.0" androix-test-uiautomator = "2.2.0" coil = "2.4.0" @@ -45,7 +45,7 @@ material = "1.11.0" # @keep minSdk = "21" okhttp = "4.11.0" -robolectric = "4.11.1" +robolectric = "4.12.1" rome = "1.18.0" room = "2.6.0" secrets = "2.0.1" From ce7cf3168b2fc14161e727346bcd31b5b85f3817 Mon Sep 17 00:00:00 2001 From: yongsuk44 Date: Sun, 7 Apr 2024 15:43:08 +0900 Subject: [PATCH 5/9] [Jetcaster] Update Home windowInsets --- .../src/main/java/com/example/jetcaster/ui/home/Home.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/home/Home.kt b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/home/Home.kt index 571648e9cc..937b18e0ce 100644 --- a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/home/Home.kt +++ b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/home/Home.kt @@ -24,17 +24,15 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn -import androidx.compose.foundation.layout.only +import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBars -import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.layout.windowInsetsTopHeight import androidx.compose.foundation.lazy.LazyColumn @@ -185,9 +183,7 @@ fun Home( onTogglePodcastFollowed: (String) -> Unit, ) { Column( - modifier = modifier.windowInsetsPadding( - WindowInsets.systemBars.only(WindowInsetsSides.Horizontal) - ) + modifier = modifier.windowInsetsPadding(WindowInsets.navigationBars) ) { // We dynamically theme this sub-section of the layout to match the selected // 'top podcast' From c5441377a1b58053b08a264625d31ebbc1b68542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Wed, 10 Apr 2024 15:30:03 +0200 Subject: [PATCH 6/9] Remove color states from the JetsnackColors --- .../com/example/jetsnack/ui/theme/Theme.kt | 195 +++--------------- 1 file changed, 33 insertions(+), 162 deletions(-) diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/theme/Theme.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/theme/Theme.kt index b54a5f3c73..75558ecc7a 100644 --- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/theme/Theme.kt +++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/theme/Theme.kt @@ -21,11 +21,7 @@ import androidx.compose.material.Colors import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider -import androidx.compose.runtime.Stable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue +import androidx.compose.runtime.Immutable import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color @@ -107,169 +103,44 @@ object JetsnackTheme { /** * Jetsnack custom Color Palette */ -@Stable -class JetsnackColors( - gradient6_1: List, - gradient6_2: List, - gradient3_1: List, - gradient3_2: List, - gradient2_1: List, - gradient2_2: List, - gradient2_3: List, - brand: Color, - brandSecondary: Color, - uiBackground: Color, - uiBorder: Color, - uiFloated: Color, - interactivePrimary: List = gradient2_1, - interactiveSecondary: List = gradient2_2, - interactiveMask: List = gradient6_1, - textPrimary: Color = brand, - textSecondary: Color, - textHelp: Color, - textInteractive: Color, - textLink: Color, - tornado1: List, - iconPrimary: Color = brand, - iconSecondary: Color, - iconInteractive: Color, - iconInteractiveInactive: Color, - error: Color, - notificationBadge: Color = error, - isDark: Boolean -) { - var gradient6_1 by mutableStateOf(gradient6_1) - private set - var gradient6_2 by mutableStateOf(gradient6_2) - private set - var gradient3_1 by mutableStateOf(gradient3_1) - private set - var gradient3_2 by mutableStateOf(gradient3_2) - private set - var gradient2_1 by mutableStateOf(gradient2_1) - private set - var gradient2_2 by mutableStateOf(gradient2_2) - private set - var gradient2_3 by mutableStateOf(gradient2_3) - private set - var brand by mutableStateOf(brand) - private set - var brandSecondary by mutableStateOf(brandSecondary) - private set - var uiBackground by mutableStateOf(uiBackground) - private set - var uiBorder by mutableStateOf(uiBorder) - private set - var uiFloated by mutableStateOf(uiFloated) - private set - var interactivePrimary by mutableStateOf(interactivePrimary) - private set - var interactiveSecondary by mutableStateOf(interactiveSecondary) - private set - var interactiveMask by mutableStateOf(interactiveMask) - private set - var textPrimary by mutableStateOf(textPrimary) - private set - var textSecondary by mutableStateOf(textSecondary) - private set - var textHelp by mutableStateOf(textHelp) - private set - var textInteractive by mutableStateOf(textInteractive) - private set - var tornado1 by mutableStateOf(tornado1) - private set - var textLink by mutableStateOf(textLink) - private set - var iconPrimary by mutableStateOf(iconPrimary) - private set - var iconSecondary by mutableStateOf(iconSecondary) - private set - var iconInteractive by mutableStateOf(iconInteractive) - private set - var iconInteractiveInactive by mutableStateOf(iconInteractiveInactive) - private set - var error by mutableStateOf(error) - private set - var notificationBadge by mutableStateOf(notificationBadge) - private set - var isDark by mutableStateOf(isDark) - private set - - fun update(other: JetsnackColors) { - gradient6_1 = other.gradient6_1 - gradient6_2 = other.gradient6_2 - gradient3_1 = other.gradient3_1 - gradient3_2 = other.gradient3_2 - gradient2_1 = other.gradient2_1 - gradient2_2 = other.gradient2_2 - gradient2_3 = other.gradient2_3 - brand = other.brand - brandSecondary = other.brandSecondary - uiBackground = other.uiBackground - uiBorder = other.uiBorder - uiFloated = other.uiFloated - interactivePrimary = other.interactivePrimary - interactiveSecondary = other.interactiveSecondary - interactiveMask = other.interactiveMask - textPrimary = other.textPrimary - textSecondary = other.textSecondary - textHelp = other.textHelp - textInteractive = other.textInteractive - textLink = other.textLink - tornado1 = other.tornado1 - iconPrimary = other.iconPrimary - iconSecondary = other.iconSecondary - iconInteractive = other.iconInteractive - iconInteractiveInactive = other.iconInteractiveInactive - error = other.error - notificationBadge = other.notificationBadge - isDark = other.isDark - } - - fun copy(): JetsnackColors = JetsnackColors( - gradient6_1 = gradient6_1, - gradient6_2 = gradient6_2, - gradient3_1 = gradient3_1, - gradient3_2 = gradient3_2, - gradient2_1 = gradient2_1, - gradient2_2 = gradient2_2, - gradient2_3 = gradient2_3, - brand = brand, - brandSecondary = brandSecondary, - uiBackground = uiBackground, - uiBorder = uiBorder, - uiFloated = uiFloated, - interactivePrimary = interactivePrimary, - interactiveSecondary = interactiveSecondary, - interactiveMask = interactiveMask, - textPrimary = textPrimary, - textSecondary = textSecondary, - textHelp = textHelp, - textInteractive = textInteractive, - textLink = textLink, - tornado1 = tornado1, - iconPrimary = iconPrimary, - iconSecondary = iconSecondary, - iconInteractive = iconInteractive, - iconInteractiveInactive = iconInteractiveInactive, - error = error, - notificationBadge = notificationBadge, - isDark = isDark, - ) -} +@Immutable +data class JetsnackColors( + val gradient6_1: List, + val gradient6_2: List, + val gradient3_1: List, + val gradient3_2: List, + val gradient2_1: List, + val gradient2_2: List, + val gradient2_3: List, + val brand: Color, + val brandSecondary: Color, + val uiBackground: Color, + val uiBorder: Color, + val uiFloated: Color, + val interactivePrimary: List = gradient2_1, + val interactiveSecondary: List = gradient2_2, + val interactiveMask: List = gradient6_1, + val textPrimary: Color = brand, + val textSecondary: Color, + val textHelp: Color, + val textInteractive: Color, + val textLink: Color, + val tornado1: List, + val iconPrimary: Color = brand, + val iconSecondary: Color, + val iconInteractive: Color, + val iconInteractiveInactive: Color, + val error: Color, + val notificationBadge: Color = error, + val isDark: Boolean +) @Composable fun ProvideJetsnackColors( colors: JetsnackColors, content: @Composable () -> Unit ) { - val colorPalette = remember { - // Explicitly creating a new object here so we don't mutate the initial [colors] - // provided, and overwrite the values set in it. - colors.copy() - } - colorPalette.update(colors) - CompositionLocalProvider(LocalJetsnackColors provides colorPalette, content = content) + CompositionLocalProvider(LocalJetsnackColors provides colors, content = content) } private val LocalJetsnackColors = staticCompositionLocalOf { From bc6e74b6cbafada96f4a49077f4930c8851286a9 Mon Sep 17 00:00:00 2001 From: yongsuk44 Date: Fri, 12 Apr 2024 14:59:38 +0900 Subject: [PATCH 7/9] [Jetcaster] Refactoring HTML Elements in SummaryText --- .../jetcaster/ui/player/PlayerScreen.kt | 51 ++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt index f5a3ae922b..3ce61c5e45 100644 --- a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt +++ b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt @@ -40,6 +40,7 @@ import androidx.compose.foundation.layout.systemBarsPadding import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.foundation.verticalScroll import androidx.compose.material.CircularProgressIndicator import androidx.compose.material.ContentAlpha @@ -77,12 +78,14 @@ import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.role import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp +import androidx.core.text.HtmlCompat import androidx.window.layout.DisplayFeature import androidx.window.layout.FoldingFeature import coil.compose.AsyncImage @@ -332,19 +335,16 @@ private fun PlayerContentBookStart( .fillMaxSize() .verticalScroll(rememberScrollState()) .padding( - vertical = 8.dp, + vertical = 40.dp, horizontal = 16.dp ), horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.SpaceAround ) { - Spacer(modifier = Modifier.height(32.dp)) PodcastInformation( - uiState.title, - uiState.podcastName, - uiState.summary + title = uiState.title, + name = uiState.podcastName, + summary = uiState.summary, ) - Spacer(modifier = Modifier.height(32.dp)) } } @@ -445,12 +445,13 @@ private fun PodcastInformation( title: String, name: String, summary: String, + modifier: Modifier = Modifier, titleTextStyle: TextStyle = MaterialTheme.typography.h5, nameTextStyle: TextStyle = MaterialTheme.typography.h3, ) { Column( - horizontalAlignment = Alignment.CenterHorizontally, - modifier = Modifier.padding(horizontal = 8.dp) + modifier = modifier.padding(horizontal = 8.dp), + verticalArrangement = Arrangement.spacedBy(32.dp) ) { Text( text = name, @@ -458,21 +459,18 @@ private fun PodcastInformation( maxLines = 1, overflow = TextOverflow.Ellipsis ) - Spacer(modifier = Modifier.height(32.dp)) Text( text = title, style = titleTextStyle, maxLines = 1, overflow = TextOverflow.Ellipsis ) - Spacer(modifier = Modifier.height(32.dp)) - CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) { - Text( - text = summary, - style = MaterialTheme.typography.body2, - ) - } - Spacer(modifier = Modifier.weight(1f)) + HtmlText( + text = summary, + style = MaterialTheme.typography.body2.copy( + color = LocalContentColor.current.copy(alpha = ContentAlpha.medium) + ), + ) } } @@ -587,6 +585,23 @@ private fun FullScreenLoading(modifier: Modifier = Modifier) { } } +@Composable +private fun HtmlText( + text: String, + style: TextStyle, +) { + val annotationString = buildAnnotatedString { + val htmlCompat = HtmlCompat.fromHtml(text, HtmlCompat.FROM_HTML_MODE_COMPACT) + append(htmlCompat) + } + SelectionContainer { + Text( + text = annotationString, + style = style, + ) + } +} + @Preview @Composable fun TopAppBarPreview() { From 129269a1ffb36ecc7bc27e046e27d548c64ce6ab Mon Sep 17 00:00:00 2001 From: yongsuk44 Date: Sat, 13 Apr 2024 03:01:21 +0900 Subject: [PATCH 8/9] [Jetcaster] Resolve conflicts - HtmlText --- .../com/example/jetcaster/ui/player/PlayerScreen.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt index fcf7062ca2..f1eff04cb8 100644 --- a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt +++ b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt @@ -56,6 +56,7 @@ import androidx.compose.material.icons.rounded.PlayCircleFilled import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.LocalContentColor import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Slider import androidx.compose.material3.Surface @@ -80,10 +81,10 @@ import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp +import androidx.core.text.HtmlCompat import androidx.hilt.navigation.compose.hiltViewModel import androidx.window.core.layout.WindowSizeClass import androidx.window.core.layout.WindowWidthSizeClass -import androidx.core.text.HtmlCompat import androidx.window.layout.DisplayFeature import androidx.window.layout.FoldingFeature import coil.compose.AsyncImage @@ -640,9 +641,8 @@ private fun PodcastInformation( ) HtmlText( text = summary, - style = MaterialTheme.typography.body2.copy( - color = LocalContentColor.current.copy(alpha = ContentAlpha.medium) - ), + style = MaterialTheme.typography.bodyMedium, + color = LocalContentColor.current ) } } @@ -780,6 +780,7 @@ private fun FullScreenLoading(modifier: Modifier = Modifier) { private fun HtmlText( text: String, style: TextStyle, + color: Color ) { val annotationString = buildAnnotatedString { val htmlCompat = HtmlCompat.fromHtml(text, HtmlCompat.FROM_HTML_MODE_COMPACT) @@ -789,6 +790,7 @@ private fun HtmlText( Text( text = annotationString, style = style, + color = color ) } } From 5a82b731668084697f3d2508735820d59cadd9e0 Mon Sep 17 00:00:00 2001 From: yongsuk44 Date: Sat, 13 Apr 2024 03:27:45 +0900 Subject: [PATCH 9/9] [Jetcaster] Fix PodcastInformation Center Alignment --- .../main/java/com/example/jetcaster/ui/player/PlayerScreen.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt index f1eff04cb8..9008507cfa 100644 --- a/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt +++ b/Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt @@ -625,7 +625,8 @@ private fun PodcastInformation( ) { Column( modifier = modifier.padding(horizontal = 8.dp), - verticalArrangement = Arrangement.spacedBy(32.dp) + verticalArrangement = Arrangement.spacedBy(32.dp), + horizontalAlignment = Alignment.CenterHorizontally, ) { Text( text = name,