From 8eb3ebc91ff09bd81b5a669d5568d2120782b3e1 Mon Sep 17 00:00:00 2001 From: Olivier Patry Date: Sat, 5 Oct 2024 13:23:05 +0200 Subject: [PATCH] Adjust theming of Android system bars [Theme Android system bars](https://developer.android.com/design/ui/mobile/guides/foundations/system-bars) --- gradle/libs.versions.toml | 2 + tasks-app-android/build.gradle.kts | 3 + .../src/main/assets/licenses_android.json | 203 +++++++++++++++++- .../src/main/res/values-night/bools.xml | 25 +++ .../src/main/res/values-night/colors.xml | 32 +++ .../src/main/res/values/bools.xml | 25 +++ .../src/main/res/values/colors.xml | 8 +- .../src/main/res/values/themes.xml | 16 +- 8 files changed, 308 insertions(+), 6 deletions(-) create mode 100644 tasks-app-android/src/main/res/values-night/bools.xml create mode 100644 tasks-app-android/src/main/res/values-night/colors.xml create mode 100644 tasks-app-android/src/main/res/values/bools.xml diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 54de7aa2..aae9840b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,6 +9,7 @@ ksp = "2.0.20-1.0.24" coroutines = "1.9.0" ktor = "3.0.0-rc-2" compose-plugin = "1.7.0-rc01" +material = "1.12.0" room = "2.7.0-alpha09" sqlite = "2.5.0-alpha09" koin = "4.0.0" @@ -58,6 +59,7 @@ coil-network = { module = "io.coil-kt.coil3:coil-network-ktor2", version.ref = " androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" } androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.9.2" } +material = { module = "com.google.android.material:material", version.ref = "material" } firebase-bom = { module = "com.google.firebase:firebase-bom", version = "33.4.0" } firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" } diff --git a/tasks-app-android/build.gradle.kts b/tasks-app-android/build.gradle.kts index 25aa2221..3bd312c7 100644 --- a/tasks-app-android/build.gradle.kts +++ b/tasks-app-android/build.gradle.kts @@ -171,6 +171,9 @@ dependencies { implementation(libs.koin.compose.viewmodel) implementation(compose.material3) + implementation(libs.material) { + because("need Material3 App theme") + } implementation(libs.androidx.activity.compose) implementation(libs.androidx.appcompat) diff --git a/tasks-app-android/src/main/assets/licenses_android.json b/tasks-app-android/src/main/assets/licenses_android.json index 17b20093..28d7bb67 100644 --- a/tasks-app-android/src/main/assets/licenses_android.json +++ b/tasks-app-android/src/main/assets/licenses_android.json @@ -161,6 +161,20 @@ "Apache-2.0" ] }, + { + "uniqueId": "androidx.cardview:cardview", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.0.0", + "description": "Android Support CardView v7", + "name": "Support CardView v7", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "androidx.collection:collection-jvm", "developers": [ @@ -532,6 +546,48 @@ "Apache-2.0" ] }, + { + "uniqueId": "androidx.constraintlayout:constraintlayout", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "2.0.1", + "description": "ConstraintLayout for Android", + "name": "Android ConstraintLayout", + "licenses": [ + "Apache-2.0" + ] + }, + { + "uniqueId": "androidx.constraintlayout:constraintlayout-solver", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "2.0.1", + "description": "Solver for ConstraintLayout", + "name": "Android ConstraintLayout Solver", + "licenses": [ + "Apache-2.0" + ] + }, + { + "uniqueId": "androidx.coordinatorlayout:coordinatorlayout", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.1.0", + "description": "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.", + "name": "Support Coordinator Layout", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "androidx.core:core", "developers": [ @@ -587,7 +643,7 @@ "name": "The Android Open Source Project" } ], - "artifactVersion": "1.0.0", + "artifactVersion": "1.1.0", "description": "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.", "name": "Support Custom View", "licenses": [ @@ -665,7 +721,7 @@ ] }, { - "uniqueId": "androidx.drawerlayout:drawerlayout", + "uniqueId": "androidx.documentfile:documentfile", "developers": [ { "name": "The Android Open Source Project" @@ -673,11 +729,39 @@ ], "artifactVersion": "1.0.0", "description": "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.", + "name": "Support Document File", + "licenses": [ + "Apache-2.0" + ] + }, + { + "uniqueId": "androidx.drawerlayout:drawerlayout", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.1.1", + "description": "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.", "name": "Support Drawer Layout", "licenses": [ "Apache-2.0" ] }, + { + "uniqueId": "androidx.dynamicanimation:dynamicanimation", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.0.0", + "description": "Physics-based animation in support library, where the animations are driven by physics force. You can use this Animation library to create smooth and realistic animations.", + "name": "Support DynamicAnimation", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "androidx.emoji2:emoji2", "developers": [ @@ -785,6 +869,20 @@ "Apache-2.0" ] }, + { + "uniqueId": "androidx.legacy:legacy-support-core-utils", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.0.0", + "description": "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.", + "name": "Support core utils", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "androidx.lifecycle:lifecycle-common-java8", "developers": [ @@ -1054,6 +1152,34 @@ "Apache-2.0" ] }, + { + "uniqueId": "androidx.localbroadcastmanager:localbroadcastmanager", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.0.0", + "description": "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.", + "name": "Support Local Broadcast Manager", + "licenses": [ + "Apache-2.0" + ] + }, + { + "uniqueId": "androidx.print:print", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.0.0", + "description": "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.", + "name": "Support Print", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "androidx.profileinstaller:profileinstaller", "developers": [ @@ -1068,6 +1194,20 @@ "Apache-2.0" ] }, + { + "uniqueId": "androidx.recyclerview:recyclerview", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.1.0", + "description": "Android Support RecyclerView v7", + "name": "Support RecyclerView v7", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "androidx.resourceinspection:resourceinspection-annotation", "developers": [ @@ -1240,6 +1380,23 @@ "Apache-2.0" ] }, + { + "uniqueId": "androidx.transition:transition", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.5.0", + "description": "Android Transition Support Library", + "name": "Transition", + "licenses": [ + "Apache-2.0" + ], + "organization": { + "name": "The Android Open Source Project" + } + }, { "uniqueId": "androidx.vectordrawable:vectordrawable", "developers": [ @@ -1282,6 +1439,20 @@ "Apache-2.0" ] }, + { + "uniqueId": "androidx.viewpager2:viewpager2", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.0.0", + "description": "AndroidX Widget ViewPager2", + "name": "AndroidX Widget ViewPager2", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "androidx.viewpager:viewpager", "developers": [ @@ -1554,6 +1725,20 @@ "ASDKL" ] }, + { + "uniqueId": "com.google.android.material:material", + "developers": [ + { + "name": "The Android Open Source Project" + } + ], + "artifactVersion": "1.12.0", + "description": "Material Components for Android is a static library that you can add to your Android application in order to use APIs that provide implementations of the Material Design specification. Compatible on devices running API 14 or later.", + "name": "Material Components for Android", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "com.google.errorprone:error_prone_annotations", "developers": [ @@ -2328,6 +2513,20 @@ "Apache-2.0" ] }, + { + "uniqueId": "org.jetbrains.kotlin:kotlin-bom", + "developers": [ + { + "name": "JetBrains Team" + } + ], + "artifactVersion": "1.8.22", + "description": "Kotlin is a statically typed programming language that compiles to JVM byte codes and JavaScript", + "name": "Kotlin Libraries bill-of-materials", + "licenses": [ + "Apache-2.0" + ] + }, { "uniqueId": "org.jetbrains.kotlin:kotlin-reflect", "developers": [ diff --git a/tasks-app-android/src/main/res/values-night/bools.xml b/tasks-app-android/src/main/res/values-night/bools.xml new file mode 100644 index 00000000..d21452cd --- /dev/null +++ b/tasks-app-android/src/main/res/values-night/bools.xml @@ -0,0 +1,25 @@ + + + + false + \ No newline at end of file diff --git a/tasks-app-android/src/main/res/values-night/colors.xml b/tasks-app-android/src/main/res/values-night/colors.xml new file mode 100644 index 00000000..baeb9e73 --- /dev/null +++ b/tasks-app-android/src/main/res/values-night/colors.xml @@ -0,0 +1,32 @@ + + + + + + + #FFFFFFFF + + #FF222222 + \ No newline at end of file diff --git a/tasks-app-android/src/main/res/values/bools.xml b/tasks-app-android/src/main/res/values/bools.xml new file mode 100644 index 00000000..593c1f73 --- /dev/null +++ b/tasks-app-android/src/main/res/values/bools.xml @@ -0,0 +1,25 @@ + + + + true + \ No newline at end of file diff --git a/tasks-app-android/src/main/res/values/colors.xml b/tasks-app-android/src/main/res/values/colors.xml index 94a95849..7955a50c 100644 --- a/tasks-app-android/src/main/res/values/colors.xml +++ b/tasks-app-android/src/main/res/values/colors.xml @@ -21,5 +21,11 @@ --> - #006B58 + + + #FF006B58 + + #FFFFFFFF \ No newline at end of file diff --git a/tasks-app-android/src/main/res/values/themes.xml b/tasks-app-android/src/main/res/values/themes.xml index b906ff7d..74c5f4a8 100644 --- a/tasks-app-android/src/main/res/values/themes.xml +++ b/tasks-app-android/src/main/res/values/themes.xml @@ -20,11 +20,21 @@ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> - - - \ No newline at end of file