From a9a2f2fa2c49f52d13227f67adbe5070e1f609e9 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Sat, 25 Jan 2025 12:03:06 -0500 Subject: [PATCH 1/2] [ADDED] Kodee in debug builds --- .../weatheralert/ui/about/AboutAppScreen.kt | 30 ++++++++--- .../main/res/drawable/kodee_sharing_love.xml | 54 +++++++++++++++++++ 2 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/kodee_sharing_love.xml diff --git a/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt b/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt index c1afa53..b438302 100644 --- a/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt +++ b/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt @@ -75,7 +75,13 @@ class AboutAppPresenter @Composable override fun present(): AboutAppScreen.State { val uriHandler = LocalUriHandler.current - val appVersion = "v${BuildConfig.VERSION_NAME} (${BuildConfig.GIT_COMMIT_HASH})" + val appVersion = buildString { + append("v") + append(BuildConfig.VERSION_NAME) + append(" (") + append(BuildConfig.GIT_COMMIT_HASH) + append(")") + } LaunchedImpressionEffect { analytics.logScreenView(AboutAppScreen::class) @@ -175,11 +181,23 @@ fun AboutAppScreen( state.eventSink(AboutAppScreen.Event.OpenGitHubProject) }, modifier = Modifier.align(Alignment.CenterHorizontally)) { Text("View Source") } } - Text( - text = "Version: ${state.appVersion}", - style = MaterialTheme.typography.labelMedium, - modifier = Modifier.align(Alignment.CenterHorizontally).padding(bottom = 16.dp), - ) + Column(modifier = Modifier.fillMaxWidth()) { + if(BuildConfig.DEBUG) { + // For fun, show Kodee in debug build + Image( + painter = painterResource(id = R.drawable.kodee_sharing_love), + contentDescription = "Kotlin Kodee Mascot", + modifier = + Modifier + .align(Alignment.CenterHorizontally), + ) + } + Text( + text = "Version: ${state.appVersion}", + style = MaterialTheme.typography.labelMedium, + modifier = Modifier.align(Alignment.CenterHorizontally).padding(bottom = 16.dp), + ) + } } } } diff --git a/app/src/main/res/drawable/kodee_sharing_love.xml b/app/src/main/res/drawable/kodee_sharing_love.xml new file mode 100644 index 0000000..13f38e8 --- /dev/null +++ b/app/src/main/res/drawable/kodee_sharing_love.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + From 18a32e823d573502be394fde9f65d41a4e50b675 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Sat, 25 Jan 2025 12:05:24 -0500 Subject: [PATCH 2/2] [ADDED] Kodee in debug build Closes #223 --- .../weatheralert/ui/about/AboutAppScreen.kt | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt b/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt index b438302..736d269 100644 --- a/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt +++ b/app/src/main/java/dev/hossain/weatheralert/ui/about/AboutAppScreen.kt @@ -75,13 +75,14 @@ class AboutAppPresenter @Composable override fun present(): AboutAppScreen.State { val uriHandler = LocalUriHandler.current - val appVersion = buildString { - append("v") - append(BuildConfig.VERSION_NAME) - append(" (") - append(BuildConfig.GIT_COMMIT_HASH) - append(")") - } + val appVersion = + buildString { + append("v") + append(BuildConfig.VERSION_NAME) + append(" (") + append(BuildConfig.GIT_COMMIT_HASH) + append(")") + } LaunchedImpressionEffect { analytics.logScreenView(AboutAppScreen::class) @@ -182,14 +183,14 @@ fun AboutAppScreen( }, modifier = Modifier.align(Alignment.CenterHorizontally)) { Text("View Source") } } Column(modifier = Modifier.fillMaxWidth()) { - if(BuildConfig.DEBUG) { + if (BuildConfig.DEBUG) { // For fun, show Kodee in debug build Image( painter = painterResource(id = R.drawable.kodee_sharing_love), contentDescription = "Kotlin Kodee Mascot", modifier = - Modifier - .align(Alignment.CenterHorizontally), + Modifier + .align(Alignment.CenterHorizontally), ) } Text(