This repository was archived by the owner on Jul 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +36
-15
lines changed
java/com/example/android/splashscreen Expand file tree Collapse file tree 10 files changed +36
-15
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ plugins {
20
20
}
21
21
22
22
android {
23
+ namespace ' com.example.android.splashscreen'
24
+ testNamespace ' com.example.android.splashscreen.test'
23
25
compileSdkVersion 33
24
26
25
27
defaultConfig {
@@ -52,10 +54,10 @@ dependencies {
52
54
// Use the SplashScreen compat library.
53
55
implementation ' androidx.core:core-splashscreen:1.0.0'
54
56
55
- implementation ' androidx.core:core-ktx:1.8 .0'
56
- implementation ' androidx.activity:activity-ktx:1.5 .1'
57
- implementation ' androidx.appcompat:appcompat:1.5.0 '
58
- implementation ' com.google.android.material:material:1.6.1 '
57
+ implementation ' androidx.core:core-ktx:1.9 .0'
58
+ implementation ' androidx.activity:activity-ktx:1.6 .1'
59
+ implementation ' androidx.appcompat:appcompat:1.5.1 '
60
+ implementation ' com.google.android.material:material:1.7.0 '
59
61
60
62
def lifecycle_version = ' 2.5.1'
61
63
implementation " androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version "
Original file line number Diff line number Diff line change 16
16
-->
17
17
<manifest
18
18
xmlns : android =" http://schemas.android.com/apk/res/android"
19
- package = " com.example.android.splashscreen.test " >
19
+ >
20
20
21
21
<!-- Export the activities from AndroidX Testing Library. -->
22
22
<application >
Original file line number Diff line number Diff line change 14
14
~ See the License for the specific language governing permissions and
15
15
~ limitations under the License.
16
16
-->
17
- <manifest
18
- xmlns : android =" http://schemas.android.com/apk/res/android"
19
- package =" com.example.android.splashscreen" >
17
+ <manifest xmlns : android =" http://schemas.android.com/apk/res/android" >
20
18
21
19
<application
22
20
android : allowBackup =" false"
Original file line number Diff line number Diff line change @@ -50,14 +50,11 @@ abstract class MainActivity : AppCompatActivity() {
50
50
51
51
// Show the in-app dark theme settings. This is available on API level 31 and above.
52
52
if (Build .VERSION .SDK_INT >= 31 ) {
53
- var previousMode: Int? = null
54
53
viewModel.nightMode.observe(this ) { nightMode ->
55
54
val radioButtonId = radioButtonId(nightMode)
56
55
if (binding.theme.checkedRadioButtonId != radioButtonId) {
57
56
binding.theme.check(radioButtonId)
58
57
}
59
- if (previousMode == null ) previousMode = nightMode
60
- if (previousMode != nightMode) recreate()
61
58
}
62
59
binding.theme.setOnCheckedChangeListener { _, checkedId ->
63
60
viewModel.updateNightMode(nightMode(checkedId))
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <!--
3
+ ~ Copyright (C) 2022 The Android Open Source Project
4
+ ~
5
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
6
+ ~ you may not use this file except in compliance with the License.
7
+ ~ You may obtain a copy of the License at
8
+ ~
9
+ ~ http://www.apache.org/licenses/LICENSE-2.0
10
+ ~
11
+ ~ Unless required by applicable law or agreed to in writing, software
12
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
13
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ~ See the License for the specific language governing permissions and
15
+ ~ limitations under the License.
16
+ -->
17
+ <resources >
18
+ <color name =" splash_screen_background" >@color/blue_gray_900</color >
19
+ </resources >
Original file line number Diff line number Diff line change 17
17
<resources xmlns : tools =" http://schemas.android.com/tools" >
18
18
<style name =" Base.Theme.App" parent =" Theme.MaterialComponents.NoActionBar" >
19
19
<item name =" android:windowLightStatusBar" tools : targetApi =" 23" >false</item >
20
+ <item name =" android:windowLightNavigationBar" tools : targetApi =" 27" >false</item >
20
21
</style >
21
22
</resources >
Original file line number Diff line number Diff line change 19
19
<color name =" lime_700" >#AFB42B</color >
20
20
<color name =" blue_gray_500" >#607D8B</color >
21
21
<color name =" blue_gray_700" >#455A64</color >
22
+ <color name =" blue_gray_900" >#263238</color >
23
+
24
+ <color name =" splash_screen_background" >@color/lime_500</color >
22
25
</resources >
Original file line number Diff line number Diff line change 18
18
19
19
<style name =" Base.Theme.App" parent =" Theme.MaterialComponents.Light.NoActionBar" >
20
20
<item name =" android:windowLightStatusBar" tools : targetApi =" 23" >true</item >
21
+ <item name =" android:windowLightNavigationBar" tools : targetApi =" 27" >true</item >
21
22
</style >
22
23
23
24
<!--
60
61
<!-- The background color behind the icon. -->
61
62
<item name =" windowSplashScreenIconBackgroundColor" >@color/lime_700</item >
62
63
<!-- The background color for the splash screen. -->
63
- <item name =" windowSplashScreenBackground" >@color/lime_500 </item >
64
+ <item name =" windowSplashScreenBackground" >@color/splash_screen_background </item >
64
65
<!-- The duration, in milliseconds, of the icon animation of the splash screen. -->
65
66
<item name =" windowSplashScreenAnimationDuration" >1000</item >
66
67
<!-- The 'core-splashscreen' switches the theme back to this after splash screen. -->
Original file line number Diff line number Diff line change 15
15
*/
16
16
17
17
buildscript {
18
- ext. kotlin_version = ' 1.7.10 '
18
+ ext. kotlin_version = ' 1.7.20 '
19
19
repositories {
20
20
google()
21
21
mavenCentral()
22
22
}
23
23
dependencies {
24
- classpath ' com.android.tools.build:gradle:7.2.2 '
24
+ classpath ' com.android.tools.build:gradle:7.3.1 '
25
25
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
26
26
}
27
27
}
Original file line number Diff line number Diff line change 1
1
# Thu Jul 29 11:47:27 JST 2021
2
2
distributionBase =GRADLE_USER_HOME
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-7.3.3 -bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-7.4 -bin.zip
4
4
distributionPath =wrapper/dists
5
5
zipStorePath =wrapper/dists
6
6
zipStoreBase =GRADLE_USER_HOME
You can’t perform that action at this time.
0 commit comments