diff options
| author | 2023-03-13 23:14:31 -0400 | |
|---|---|---|
| committer | 2023-06-03 00:05:42 -0700 | |
| commit | 18f4ef436d3bb2c2e8347b4930ba5ebad0452a00 (patch) | |
| tree | b25171b0689ffbe0db9d896035445d4b4a48ab7e /src/android | |
| parent | android: Use vector icons (diff) | |
| download | yuzu-18f4ef436d3bb2c2e8347b4930ba5ebad0452a00.tar.gz yuzu-18f4ef436d3bb2c2e8347b4930ba5ebad0452a00.tar.xz yuzu-18f4ef436d3bb2c2e8347b4930ba5ebad0452a00.zip | |
android: Modernize theme system
Diffstat (limited to 'src/android')
| -rw-r--r-- | src/android/app/src/main/AndroidManifest.xml | 6 | ||||
| -rw-r--r-- | src/android/app/src/main/res/values-night/colors.xml | 18 | ||||
| -rw-r--r-- | src/android/app/src/main/res/values-night/yuzu_colors.xml | 35 | ||||
| -rw-r--r-- | src/android/app/src/main/res/values-v29/themes.xml | 11 | ||||
| -rw-r--r-- | src/android/app/src/main/res/values/colors.xml | 18 | ||||
| -rw-r--r-- | src/android/app/src/main/res/values/styles.xml | 59 | ||||
| -rw-r--r-- | src/android/app/src/main/res/values/themes.xml | 42 | ||||
| -rw-r--r-- | src/android/app/src/main/res/values/yuzu_colors.xml | 35 |
8 files changed, 130 insertions, 94 deletions
diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 73ed981c1..6c6720222 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | <activity | 32 | <activity |
| 33 | android:name="org.yuzu.yuzu_emu.ui.main.MainActivity" | 33 | android:name="org.yuzu.yuzu_emu.ui.main.MainActivity" |
| 34 | android:exported="true" | 34 | android:exported="true" |
| 35 | android:theme="@style/YuzuBase" | 35 | android:theme="@style/Theme.Yuzu.Main" |
| 36 | android:resizeableActivity="false"> | 36 | android:resizeableActivity="false"> |
| 37 | 37 | ||
| 38 | <!-- This intentfilter marks this Activity as the one that gets launched from Home screen. --> | 38 | <!-- This intentfilter marks this Activity as the one that gets launched from Home screen. --> |
| @@ -46,13 +46,13 @@ | |||
| 46 | <activity | 46 | <activity |
| 47 | android:name="org.yuzu.yuzu_emu.features.settings.ui.SettingsActivity" | 47 | android:name="org.yuzu.yuzu_emu.features.settings.ui.SettingsActivity" |
| 48 | android:configChanges="orientation|screenSize|uiMode" | 48 | android:configChanges="orientation|screenSize|uiMode" |
| 49 | android:theme="@style/YuzuSettingsBase" | 49 | android:theme="@style/Theme.Yuzu.Main" |
| 50 | android:label="@string/preferences_settings"/> | 50 | android:label="@string/preferences_settings"/> |
| 51 | 51 | ||
| 52 | <activity | 52 | <activity |
| 53 | android:name="org.yuzu.yuzu_emu.activities.EmulationActivity" | 53 | android:name="org.yuzu.yuzu_emu.activities.EmulationActivity" |
| 54 | android:resizeableActivity="false" | 54 | android:resizeableActivity="false" |
| 55 | android:theme="@style/YuzuEmulationBase" | 55 | android:theme="@style/Theme.Yuzu.Main" |
| 56 | android:launchMode="singleTop" | 56 | android:launchMode="singleTop" |
| 57 | android:screenOrientation="landscape"/> | 57 | android:screenOrientation="landscape"/> |
| 58 | 58 | ||
diff --git a/src/android/app/src/main/res/values-night/colors.xml b/src/android/app/src/main/res/values-night/colors.xml deleted file mode 100644 index d71d2acb2..000000000 --- a/src/android/app/src/main/res/values-night/colors.xml +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <resources> | ||
| 3 | |||
| 4 | <color name="citra_orange">#272727</color> | ||
| 5 | <color name="citra_orange_dark">#121212</color> | ||
| 6 | <color name="citra_accent">#FEC303</color> | ||
| 7 | |||
| 8 | <color name="view_background">#121212</color> | ||
| 9 | <color name="view_disabled">#3D3D3D</color> | ||
| 10 | <color name="view_text">#FF0000</color> | ||
| 11 | |||
| 12 | <color name="gamelist_divider">#404040</color> | ||
| 13 | |||
| 14 | <color name="header_text">#E0E0E0</color> | ||
| 15 | <color name="header_subtext">#A0A0A0</color> | ||
| 16 | |||
| 17 | <color name="yuzu_logo_text_color">@color/citra_accent</color> | ||
| 18 | </resources> | ||
diff --git a/src/android/app/src/main/res/values-night/yuzu_colors.xml b/src/android/app/src/main/res/values-night/yuzu_colors.xml new file mode 100644 index 000000000..aace16f19 --- /dev/null +++ b/src/android/app/src/main/res/values-night/yuzu_colors.xml | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <resources> | ||
| 3 | |||
| 4 | <color name="yuzu_primary">#FFB4A8</color> | ||
| 5 | <color name="yuzu_onPrimary">#680200</color> | ||
| 6 | <color name="yuzu_primaryContainer">#930300</color> | ||
| 7 | <color name="yuzu_onPrimaryContainer">#FFDAD4</color> | ||
| 8 | <color name="yuzu_secondary">#E7BDB6</color> | ||
| 9 | <color name="yuzu_onSecondary">#442925</color> | ||
| 10 | <color name="yuzu_secondaryContainer">#5D3F3A</color> | ||
| 11 | <color name="yuzu_onSecondaryContainer">#FFDAD4</color> | ||
| 12 | <color name="yuzu_tertiary">#DEC48C</color> | ||
| 13 | <color name="yuzu_onTertiary">#3E2E04</color> | ||
| 14 | <color name="yuzu_tertiaryContainer">#564419</color> | ||
| 15 | <color name="yuzu_onTertiaryContainer">#FBE0A6</color> | ||
| 16 | <color name="yuzu_error">#FFB4AB</color> | ||
| 17 | <color name="yuzu_errorContainer">#93000A</color> | ||
| 18 | <color name="yuzu_onError">#690005</color> | ||
| 19 | <color name="yuzu_onErrorContainer">#FFDAD6</color> | ||
| 20 | <color name="yuzu_background">#201A19</color> | ||
| 21 | <color name="yuzu_onBackground">#EDE0DD</color> | ||
| 22 | <color name="yuzu_surface">#201A19</color> | ||
| 23 | <color name="yuzu_onSurface">#EDE0DD</color> | ||
| 24 | <color name="yuzu_surfaceVariant">#534341</color> | ||
| 25 | <color name="yuzu_onSurfaceVariant">#D8C2BE</color> | ||
| 26 | <color name="yuzu_outline">#A08C89</color> | ||
| 27 | <color name="yuzu_inverseOnSurface">#201A19</color> | ||
| 28 | <color name="yuzu_inverseSurface">#EDE0DD</color> | ||
| 29 | <color name="yuzu_inversePrimary">#BF0500</color> | ||
| 30 | <color name="yuzu_shadow">#000000</color> | ||
| 31 | <color name="yuzu_surfaceTint">#FFB4A8</color> | ||
| 32 | <color name="yuzu_outlineVariant">#534341</color> | ||
| 33 | <color name="yuzu_scrim">#000000</color> | ||
| 34 | |||
| 35 | </resources> | ||
diff --git a/src/android/app/src/main/res/values-v29/themes.xml b/src/android/app/src/main/res/values-v29/themes.xml new file mode 100644 index 000000000..ba436f7a4 --- /dev/null +++ b/src/android/app/src/main/res/values-v29/themes.xml | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <resources> | ||
| 3 | |||
| 4 | <style name="Theme.V29.Yuzu" parent="Theme.Yuzu"> | ||
| 5 | <item name="android:enforceStatusBarContrast">false</item> | ||
| 6 | <item name="android:enforceNavigationBarContrast">false</item> | ||
| 7 | </style> | ||
| 8 | |||
| 9 | <style name="Theme.Yuzu.Main" parent="Theme.V29.Yuzu" /> | ||
| 10 | |||
| 11 | </resources> | ||
diff --git a/src/android/app/src/main/res/values/colors.xml b/src/android/app/src/main/res/values/colors.xml deleted file mode 100644 index 8db6626c1..000000000 --- a/src/android/app/src/main/res/values/colors.xml +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <resources> | ||
| 3 | |||
| 4 | <color name="citra_orange">#FFC303</color> | ||
| 5 | <color name="citra_orange_dark">#FF8D03</color> | ||
| 6 | <color name="citra_accent">#CC7102</color> | ||
| 7 | |||
| 8 | <color name="view_background">#ffffff</color> | ||
| 9 | <color name="view_disabled">#D5D5D5</color> | ||
| 10 | <color name="view_text">#FF0000</color> | ||
| 11 | |||
| 12 | <color name="gamelist_divider">#ffffff</color> | ||
| 13 | |||
| 14 | <color name="header_text">#1C1424</color> | ||
| 15 | <color name="header_subtext">#5C5661</color> | ||
| 16 | |||
| 17 | <color name="yuzu_logo_text_color">@color/header_text</color> | ||
| 18 | </resources> | ||
diff --git a/src/android/app/src/main/res/values/styles.xml b/src/android/app/src/main/res/values/styles.xml index 773be611e..1d355f310 100644 --- a/src/android/app/src/main/res/values/styles.xml +++ b/src/android/app/src/main/res/values/styles.xml | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <resources> | 2 | <resources> |
| 3 | |||
| 3 | <!-- Custom button styles --> | 4 | <!-- Custom button styles --> |
| 4 | <style name="InGameMenuOption" parent="Widget.Material3.Button.TextButton"> | 5 | <style name="InGameMenuOption" parent="Widget.Material3.Button.TextButton"> |
| 5 | <item name="android:layout_width">match_parent</item> | 6 | <item name="android:layout_width">match_parent</item> |
| @@ -12,61 +13,9 @@ | |||
| 12 | <item name="android:paddingRight">32dp</item> | 13 | <item name="android:paddingRight">32dp</item> |
| 13 | </style> | 14 | </style> |
| 14 | 15 | ||
| 15 | <!-- Inherit from the material theme --> | 16 | <style name="YuzuSlider" parent="Widget.Material3.Slider"> |
| 16 | <style name="YuzuBase" parent="Theme.Material3.DayNight.NoActionBar"> | 17 | <item name="tickVisible">false</item> |
| 17 | <!-- Main theme colors --> | 18 | <item name="labelBehavior">gone</item> |
| 18 | <item name="colorSurface">@color/view_background</item> | ||
| 19 | <item name="colorOnSurface">@color/view_text</item> | ||
| 20 | <!-- Branding color for the app bar --> | ||
| 21 | <item name="colorPrimary">@color/citra_orange</item> | ||
| 22 | <!-- Darker variant for the status bar and contextual app bars --> | ||
| 23 | <item name="colorPrimaryDark">@color/citra_orange_dark</item> | ||
| 24 | <item name="colorAccent">@color/citra_accent</item> | ||
| 25 | |||
| 26 | <item name="titleTextColor">@color/yuzu_logo_text_color</item> | ||
| 27 | |||
| 28 | <!-- Enable window content transitions --> | ||
| 29 | <item name="android:windowContentTransitions">true</item> | ||
| 30 | <item name="android:windowAllowEnterTransitionOverlap">true</item> | ||
| 31 | <item name="android:windowAllowReturnTransitionOverlap">true</item> | ||
| 32 | |||
| 33 | <item name="android:colorControlHighlight">?attr/colorAccent</item> | ||
| 34 | </style> | ||
| 35 | |||
| 36 | <!-- Same as above, but use default action bar, and mandate margins. --> | ||
| 37 | <style name="YuzuSettingsBase" parent="Theme.Material3.DayNight"> | ||
| 38 | <item name="colorSurface">@color/view_background</item> | ||
| 39 | <item name="colorOnSurface">@color/view_text</item> | ||
| 40 | <item name="colorPrimary">@color/citra_orange</item> | ||
| 41 | <item name="colorPrimaryDark">@color/citra_orange_dark</item> | ||
| 42 | <item name="colorAccent">@color/citra_accent</item> | ||
| 43 | </style> | ||
| 44 | |||
| 45 | <!-- Inherit from the Base Citra Dialog Theme --> | ||
| 46 | <style name="YuzuEmulationBase" parent="Theme.Material3.DayNight"> | ||
| 47 | <item name="colorSurface">@color/view_background</item> | ||
| 48 | <item name="colorOnSurface">@color/view_text</item> | ||
| 49 | <item name="colorPrimary">@color/citra_orange</item> | ||
| 50 | <item name="colorPrimaryDark">@color/citra_orange_dark</item> | ||
| 51 | <item name="colorAccent">@color/citra_accent</item> | ||
| 52 | <item name="android:windowTranslucentNavigation">true</item> | ||
| 53 | <item name="android:windowBackground">@android:color/black</item> | ||
| 54 | <item name="windowActionBar">false</item> | ||
| 55 | <item name="windowNoTitle">true</item> | ||
| 56 | <item name="android:windowFullscreen">true</item> | ||
| 57 | |||
| 58 | <!-- Enable window content transitions --> | ||
| 59 | <item name="android:windowContentTransitions">true</item> | ||
| 60 | <item name="android:windowAllowEnterTransitionOverlap">true</item> | ||
| 61 | <item name="android:windowAllowReturnTransitionOverlap">true</item> | ||
| 62 | </style> | ||
| 63 | |||
| 64 | <style name="FilePickerAlertDialogTheme" parent="Theme.Material3.DayNight.Dialog.Alert"> | ||
| 65 | <item name="colorSurface">@color/view_background</item> | ||
| 66 | <item name="colorOnSurface">@color/view_text</item> | ||
| 67 | <item name="colorPrimary">@color/citra_orange</item> | ||
| 68 | <item name="colorPrimaryDark">@color/citra_orange_dark</item> | ||
| 69 | <item name="colorAccent">@color/citra_accent</item> | ||
| 70 | </style> | 19 | </style> |
| 71 | 20 | ||
| 72 | </resources> | 21 | </resources> |
diff --git a/src/android/app/src/main/res/values/themes.xml b/src/android/app/src/main/res/values/themes.xml new file mode 100644 index 000000000..268e72c4b --- /dev/null +++ b/src/android/app/src/main/res/values/themes.xml | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <resources> | ||
| 3 | |||
| 4 | <style name="Theme.Yuzu" parent="Theme.Material3.DayNight.NoActionBar"> | ||
| 5 | <item name="colorPrimary">@color/yuzu_primary</item> | ||
| 6 | <item name="colorOnPrimary">@color/yuzu_onPrimary</item> | ||
| 7 | <item name="colorPrimaryContainer">@color/yuzu_primaryContainer</item> | ||
| 8 | <item name="colorOnPrimaryContainer">@color/yuzu_onPrimaryContainer</item> | ||
| 9 | <item name="colorSecondary">@color/yuzu_secondary</item> | ||
| 10 | <item name="colorOnSecondary">@color/yuzu_onSecondary</item> | ||
| 11 | <item name="colorSecondaryContainer">@color/yuzu_secondaryContainer</item> | ||
| 12 | <item name="colorOnSecondaryContainer">@color/yuzu_onSecondaryContainer</item> | ||
| 13 | <item name="colorTertiary">@color/yuzu_tertiary</item> | ||
| 14 | <item name="colorOnTertiary">@color/yuzu_onTertiary</item> | ||
| 15 | <item name="colorTertiaryContainer">@color/yuzu_tertiaryContainer</item> | ||
| 16 | <item name="colorOnTertiaryContainer">@color/yuzu_onTertiaryContainer</item> | ||
| 17 | <item name="colorError">@color/yuzu_error</item> | ||
| 18 | <item name="colorErrorContainer">@color/yuzu_errorContainer</item> | ||
| 19 | <item name="colorOnError">@color/yuzu_onError</item> | ||
| 20 | <item name="colorOnErrorContainer">@color/yuzu_onErrorContainer</item> | ||
| 21 | <item name="android:colorBackground">@color/yuzu_background</item> | ||
| 22 | <item name="colorOnBackground">@color/yuzu_onBackground</item> | ||
| 23 | <item name="colorSurface">@color/yuzu_surface</item> | ||
| 24 | <item name="colorOnSurface">@color/yuzu_onSurface</item> | ||
| 25 | <item name="colorSurfaceVariant">@color/yuzu_surfaceVariant</item> | ||
| 26 | <item name="colorOnSurfaceVariant">@color/yuzu_onSurfaceVariant</item> | ||
| 27 | <item name="colorOutline">@color/yuzu_outline</item> | ||
| 28 | <item name="colorOnSurfaceInverse">@color/yuzu_inverseOnSurface</item> | ||
| 29 | <item name="colorSurfaceInverse">@color/yuzu_inverseSurface</item> | ||
| 30 | <item name="colorPrimaryInverse">@color/yuzu_inversePrimary</item> | ||
| 31 | <item name="android:shadowColor">@color/yuzu_shadow</item> | ||
| 32 | |||
| 33 | <item name="android:statusBarColor">@android:color/transparent</item> | ||
| 34 | <item name="android:navigationBarColor">@android:color/transparent</item> | ||
| 35 | |||
| 36 | <item name="sliderStyle">@style/YuzuSlider</item> | ||
| 37 | </style> | ||
| 38 | |||
| 39 | <!-- Trick for API >= 29 specific changes --> | ||
| 40 | <style name="Theme.Yuzu.Main" parent="Theme.Yuzu" /> | ||
| 41 | |||
| 42 | </resources> | ||
diff --git a/src/android/app/src/main/res/values/yuzu_colors.xml b/src/android/app/src/main/res/values/yuzu_colors.xml new file mode 100644 index 000000000..54b0fb005 --- /dev/null +++ b/src/android/app/src/main/res/values/yuzu_colors.xml | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <resources> | ||
| 3 | |||
| 4 | <color name="yuzu_primary">#BF0500</color> | ||
| 5 | <color name="yuzu_onPrimary">#FFFFFF</color> | ||
| 6 | <color name="yuzu_primaryContainer">#FFDAD4</color> | ||
| 7 | <color name="yuzu_onPrimaryContainer">#410100</color> | ||
| 8 | <color name="yuzu_secondary">#775651</color> | ||
| 9 | <color name="yuzu_onSecondary">#FFFFFF</color> | ||
| 10 | <color name="yuzu_secondaryContainer">#FFDAD4</color> | ||
| 11 | <color name="yuzu_onSecondaryContainer">#2C1511</color> | ||
| 12 | <color name="yuzu_tertiary">#6F5C2E</color> | ||
| 13 | <color name="yuzu_onTertiary">#FFFFFF</color> | ||
| 14 | <color name="yuzu_tertiaryContainer">#FBE0A6</color> | ||
| 15 | <color name="yuzu_onTertiaryContainer">#251A00</color> | ||
| 16 | <color name="yuzu_error">#BA1A1A</color> | ||
| 17 | <color name="yuzu_errorContainer">#FFDAD6</color> | ||
| 18 | <color name="yuzu_onError">#FFFFFF</color> | ||
| 19 | <color name="yuzu_onErrorContainer">#410002</color> | ||
| 20 | <color name="yuzu_background">#FFFBFF</color> | ||
| 21 | <color name="yuzu_onBackground">#201A19</color> | ||
| 22 | <color name="yuzu_surface">#FFFBFF</color> | ||
| 23 | <color name="yuzu_onSurface">#201A19</color> | ||
| 24 | <color name="yuzu_surfaceVariant">#F5DDD9</color> | ||
| 25 | <color name="yuzu_onSurfaceVariant">#534341</color> | ||
| 26 | <color name="yuzu_outline">#857370</color> | ||
| 27 | <color name="yuzu_inverseOnSurface">#FBEEEC</color> | ||
| 28 | <color name="yuzu_inverseSurface">#362F2E</color> | ||
| 29 | <color name="yuzu_inversePrimary">#FFB4A8</color> | ||
| 30 | <color name="yuzu_shadow">#000000</color> | ||
| 31 | <color name="yuzu_surfaceTint">#BF0500</color> | ||
| 32 | <color name="yuzu_outlineVariant">#D8C2BE</color> | ||
| 33 | <color name="yuzu_scrim">#000000</color> | ||
| 34 | |||
| 35 | </resources> | ||