Skip to content

Commit

Permalink
🎨 Android のアプリテーマを設定
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsutakein committed Dec 7, 2023
1 parent 6b133a1 commit 2cc98f3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
7 changes: 2 additions & 5 deletions app/android/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
android:theme="@style/Theme.Nito.Splash"
tools:targetApi="34">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.MyApplication">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
10 changes: 10 additions & 0 deletions app/android/src/androidMain/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="NightAdjusted.Theme.Nito" parent="android:Theme.Material.NoActionBar" />

<style name="NightAdjusted.Theme.Splash" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar">false</item>
</style>
</resources>
16 changes: 14 additions & 2 deletions app/android/src/androidMain/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Allows us to override night specific attributes in the values-night folder. -->
<style name="NightAdjusted.Theme.Nito" parent="android:Theme.Material.Light.NoActionBar" />

<style name="Theme.MyApplication" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
<!-- The final theme we use -->
<style name="Theme.Nito" parent="NightAdjusted.Theme.Nito" />

<style name="NightAdjusted.Theme.Splash" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar">true</item>
</style>

<style name="Theme.Nito.Splash" parent="NightAdjusted.Theme.Splash">
<item name="postSplashScreenTheme">@style/Theme.Nito</item>
</style>
</resources>

0 comments on commit 2cc98f3

Please sign in to comment.