mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Add Dynamic theme for Android 12 (#5569)
* Add Dynamic theme for Android 12 * Also theme text colors
This commit is contained in:
		
							
								
								
									
										5
									
								
								app/src/main/res/color-night-v31/text_primary_monet.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								app/src/main/res/color-night-v31/text_primary_monet.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:color="@android:color/system_neutral1_500" android:state_enabled="false" /> | ||||
|     <item android:color="@android:color/system_neutral1_50" /> | ||||
| </selector> | ||||
| @@ -0,0 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:alpha="?android:attr/disabledAlpha" android:color="@android:color/system_neutral2_200" android:state_enabled="false" /> | ||||
|     <item android:color="@android:color/system_neutral2_200" /> | ||||
| </selector> | ||||
							
								
								
									
										4
									
								
								app/src/main/res/color-v31/ripple_colored_monet.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								app/src/main/res/color-v31/ripple_colored_monet.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:color="@color/accent_monet" android:alpha="0.12" /> | ||||
| </selector> | ||||
							
								
								
									
										5
									
								
								app/src/main/res/color-v31/text_primary_monet.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								app/src/main/res/color-v31/text_primary_monet.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:color="@android:color/system_neutral1_400" android:state_enabled="false" /> | ||||
|     <item android:color="@android:color/system_neutral1_900" /> | ||||
| </selector> | ||||
							
								
								
									
										5
									
								
								app/src/main/res/color-v31/text_secondary_monet.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								app/src/main/res/color-v31/text_secondary_monet.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:alpha="?android:attr/disabledAlpha" android:color="@android:color/system_neutral2_700" android:state_enabled="false" /> | ||||
|     <item android:color="@android:color/system_neutral2_700" /> | ||||
| </selector> | ||||
| @@ -1,5 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
| <resources xmlns:tools="http://schemas.android.com/tools"> | ||||
|     <color name="splash">@color/background_default</color> | ||||
|  | ||||
|     <!-- Default Theme --> | ||||
| @@ -9,6 +9,15 @@ | ||||
|     <color name="background_default">#202125</color> | ||||
|     <color name="ripple_colored_default">#1F3399FF</color> | ||||
|  | ||||
|     <!-- Monet Theme --> | ||||
|     <color name="accent_monet" tools:targetApi="31">@android:color/system_accent1_100</color> | ||||
|     <color name="on_accent_monet" tools:targetApi="31">@android:color/system_accent1_900</color> | ||||
|     <color name="divider_monet" tools:targetApi="31">@android:color/system_neutral1_700</color> | ||||
|     <color name="tertiary_monet" tools:targetApi="31">@android:color/system_accent3_100</color> | ||||
|     <color name="on_tertiary_monet" tools:targetApi="31">@android:color/system_accent3_900</color> | ||||
|     <color name="surface_monet" tools:targetApi="31">@android:color/system_neutral1_900</color> | ||||
|     <color name="on_surface_monet" tools:targetApi="31">@android:color/system_neutral1_50</color> | ||||
|  | ||||
|     <!-- Green Apple Theme --> | ||||
|     <color name="accent_greenapple">#48E484</color> | ||||
|     <color name="color_on_primary_greenapple">@color/md_black_1000</color> | ||||
|   | ||||
							
								
								
									
										17
									
								
								app/src/main/res/values-v31/themes.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/src/main/res/values-v31/themes.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
|     <style name="Theme.Tachiyomi.Monet"> | ||||
|         <item name="colorPrimary">@color/accent_monet</item> | ||||
|         <item name="colorOnPrimary">@color/on_accent_monet</item> | ||||
|         <item name="colorTertiary">@color/tertiary_monet</item> | ||||
|         <item name="colorOnTertiary">@color/on_tertiary_monet</item> | ||||
|         <item name="colorSurface">@color/surface_monet</item> | ||||
|         <item name="colorOnSurface">@color/on_surface_monet</item> | ||||
|         <item name="android:colorBackground">@color/background_monet</item> | ||||
|         <item name="colorOnBackground">@color/on_background_monet</item> | ||||
|         <item name="colorControlHighlight">@color/ripple_colored_monet</item> | ||||
|         <item name="android:divider">@color/divider_monet</item> | ||||
|         <item name="android:textColorPrimary">@color/text_primary_monet</item> | ||||
|         <item name="android:textColorSecondary">@color/text_secondary_monet</item> | ||||
|     </style> | ||||
| </resources> | ||||
| @@ -1,5 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
| <resources xmlns:tools="http://schemas.android.com/tools"> | ||||
|     <color name="splash">@color/accent_blue</color> | ||||
|  | ||||
|     <!-- Default Theme --> | ||||
| @@ -9,6 +9,17 @@ | ||||
|     <color name="background_default">@color/md_grey_50</color> | ||||
|     <color name="ripple_colored_default">@color/md_blue_A400_12</color> | ||||
|  | ||||
|     <!-- Monet Theme --> | ||||
|     <color name="accent_monet" tools:targetApi="31">@android:color/system_accent1_600</color> | ||||
|     <color name="on_accent_monet" tools:targetApi="31">@android:color/system_accent1_10</color> | ||||
|     <color name="divider_monet" tools:targetApi="31">@android:color/system_neutral1_200</color> | ||||
|     <color name="tertiary_monet" tools:targetApi="31">@android:color/system_accent3_600</color> | ||||
|     <color name="on_tertiary_monet" tools:targetApi="31">@android:color/system_accent3_10</color> | ||||
|     <color name="surface_monet" tools:targetApi="31">@android:color/system_neutral1_50</color> | ||||
|     <color name="on_surface_monet" tools:targetApi="31">@android:color/system_neutral1_900</color> | ||||
|     <color name="background_monet" tools:targetApi="31">@color/surface_monet</color> | ||||
|     <color name="on_background_monet" tools:targetApi="31">@color/on_surface_monet</color> | ||||
|  | ||||
|     <!-- Blue Theme --> | ||||
|     <color name="accent_blue">#54759E</color> | ||||
|     <color name="ripple_colored_blue">#1F54759E</color> | ||||
|   | ||||
| @@ -148,6 +148,7 @@ | ||||
|     <string name="theme_dark">On</string> | ||||
|     <string name="pref_app_theme">App theme</string> | ||||
|     <string name="theme_default">Default</string> | ||||
|     <string name="theme_monet">Dynamic</string> | ||||
|     <string name="theme_blue">Blue</string> | ||||
|     <string name="theme_greenapple">Green Apple</string> | ||||
|     <string name="theme_midnightdusk">Midnight Dusk</string> | ||||
|   | ||||
| @@ -74,6 +74,9 @@ | ||||
|     <!--== Default Theme ==--> | ||||
|     <style name="Theme.Tachiyomi" parent="Base.Theme.Tachiyomi" /> | ||||
|  | ||||
|     <!-- Monet theme only support S+ --> | ||||
|     <style name="Theme.Tachiyomi.Monet" /> | ||||
|  | ||||
|     <!--== Blue Theme ==--> | ||||
|     <style name="Theme.Tachiyomi.Blue"> | ||||
|         <!-- Theme Colors --> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user