mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Initial AMOLED theme + some CardView fixes (#787)
* Initial AMOLED theme + some CardView fixes * small fix
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							2eeac0bf8b
						
					
				
				
					commit
					2118434823
				
			@@ -32,6 +32,7 @@ interface ActivityMixin {
 | 
			
		||||
    fun setAppTheme() {
 | 
			
		||||
        setTheme(when (Injekt.get<PreferencesHelper>().theme()) {
 | 
			
		||||
            2 -> R.style.Theme_Tachiyomi_Dark
 | 
			
		||||
            3 -> R.style.Theme_Tachiyomi_Amoled
 | 
			
		||||
            else -> R.style.Theme_Tachiyomi
 | 
			
		||||
        })
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,23 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<ripple
 | 
			
		||||
    xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:color="@color/colorAccentDark"
 | 
			
		||||
    >
 | 
			
		||||
    <item>
 | 
			
		||||
        <selector>
 | 
			
		||||
            <item android:state_selected="true">
 | 
			
		||||
                <color android:color="@color/selectorColorDark"/>
 | 
			
		||||
            </item>
 | 
			
		||||
 | 
			
		||||
            <item android:state_activated="true">
 | 
			
		||||
                <color android:color="@color/selectorColorDark"/>
 | 
			
		||||
            </item>
 | 
			
		||||
 | 
			
		||||
            <item>
 | 
			
		||||
                <color android:color="@color/md_black_1000"/>
 | 
			
		||||
            </item>
 | 
			
		||||
        </selector>
 | 
			
		||||
    </item>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</ripple>
 | 
			
		||||
							
								
								
									
										19
									
								
								app/src/main/res/drawable-v21/list_item_selector_amoled.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								app/src/main/res/drawable-v21/list_item_selector_amoled.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
        android:color="@color/rippleColorDark">
 | 
			
		||||
    <item>
 | 
			
		||||
        <selector>
 | 
			
		||||
            <item android:state_selected="true">
 | 
			
		||||
                <color android:color="@color/rippleColorDark"/>
 | 
			
		||||
            </item>
 | 
			
		||||
 | 
			
		||||
            <item android:state_activated="true">
 | 
			
		||||
                <color android:color="@color/rippleColorDark"/>
 | 
			
		||||
            </item>
 | 
			
		||||
 | 
			
		||||
            <item>
 | 
			
		||||
                <color android:color="@color/md_black_1000"/>
 | 
			
		||||
            </item>
 | 
			
		||||
        </selector>
 | 
			
		||||
    </item>
 | 
			
		||||
</ripple>
 | 
			
		||||
							
								
								
									
										10
									
								
								app/src/main/res/drawable/library_item_selector_amoled.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								app/src/main/res/drawable/library_item_selector_amoled.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<selector android:exitFadeDuration="@android:integer/config_longAnimTime"
 | 
			
		||||
          xmlns:android="http://schemas.android.com/apk/res/android">
 | 
			
		||||
 | 
			
		||||
    <item android:state_focused="true" android:drawable="@color/selectorColorDark"/>
 | 
			
		||||
    <item android:state_pressed="true" android:drawable="@color/selectorColorDark"/>
 | 
			
		||||
    <item android:state_activated="true" android:drawable="@color/selectorColorDark"/>
 | 
			
		||||
    <item android:drawable="@color/md_black_1000"/>
 | 
			
		||||
 | 
			
		||||
</selector>
 | 
			
		||||
							
								
								
									
										10
									
								
								app/src/main/res/drawable/list_item_selector_amoled.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								app/src/main/res/drawable/list_item_selector_amoled.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
          android:exitFadeDuration="@android:integer/config_longAnimTime">
 | 
			
		||||
 | 
			
		||||
    <item android:drawable="@color/rippleColorDark" android:state_focused="true"/>
 | 
			
		||||
    <item android:drawable="@color/rippleColorDark" android:state_pressed="true"/>
 | 
			
		||||
    <item android:drawable="@color/rippleColorDark" android:state_activated="true"/>
 | 
			
		||||
    <item android:drawable="@color/md_black_1000"/>
 | 
			
		||||
 | 
			
		||||
</selector>
 | 
			
		||||
@@ -9,6 +9,10 @@
 | 
			
		||||
        android:id="@+id/recycler"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent"
 | 
			
		||||
        android:paddingBottom="4dp"
 | 
			
		||||
        android:paddingTop="4dp"
 | 
			
		||||
        android:paddingStart="2dp"
 | 
			
		||||
        android:paddingEnd="2dp"
 | 
			
		||||
        tools:listitem="@layout/item_recently_read">
 | 
			
		||||
 | 
			
		||||
    </android.support.v7.widget.RecyclerView>
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,6 @@
 | 
			
		||||
    xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:id="@+id/cv_manga"
 | 
			
		||||
    style="@style/Theme.Widget.CardView"
 | 
			
		||||
    android:layout_marginBottom="0dp"
 | 
			
		||||
    >
 | 
			
		||||
 | 
			
		||||
    <LinearLayout
 | 
			
		||||
 
 | 
			
		||||
@@ -20,6 +20,15 @@
 | 
			
		||||
        <item name="android:navigationBarColor">@color/colorPrimaryDark</item>
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
    <!-- Amoled Theme -->
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
    <style name="Theme.Tachiyomi.Amoled" parent="Theme.Base.Amoled">
 | 
			
		||||
        <!-- Attributes specific for SDK 21 and up  -->
 | 
			
		||||
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
 | 
			
		||||
        <item name="android:statusBarColor">@android:color/transparent</item>
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
    <!-- Reader Theme -->
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
 
 | 
			
		||||
@@ -25,11 +25,13 @@
 | 
			
		||||
    <string-array name="themes_values">
 | 
			
		||||
        <item>1</item>
 | 
			
		||||
        <item>2</item>
 | 
			
		||||
        <item>3</item>
 | 
			
		||||
    </string-array>
 | 
			
		||||
 | 
			
		||||
    <string-array name="themes">
 | 
			
		||||
        <item>@string/light_theme</item>
 | 
			
		||||
        <item>@string/dark_theme</item>
 | 
			
		||||
        <item>@string/amoled_theme</item>
 | 
			
		||||
    </string-array>
 | 
			
		||||
 | 
			
		||||
    <string-array name="reader_themes">
 | 
			
		||||
 
 | 
			
		||||
@@ -131,6 +131,7 @@
 | 
			
		||||
    <string name="pref_theme">Application theme</string>
 | 
			
		||||
    <string name="light_theme">Main theme</string>
 | 
			
		||||
    <string name="dark_theme">Dark theme</string>
 | 
			
		||||
    <string name="amoled_theme">AMOLED theme</string>
 | 
			
		||||
    <string name="pref_start_screen">Start screen</string>
 | 
			
		||||
    <string name="pref_language">Language</string>
 | 
			
		||||
    <string name="system_default">System default</string>
 | 
			
		||||
 
 | 
			
		||||
@@ -147,10 +147,11 @@
 | 
			
		||||
        <item name="android:layout_width">match_parent</item>
 | 
			
		||||
        <item name="android:layout_height">wrap_content</item>
 | 
			
		||||
        <item name="cardBackgroundColor">?attr/background_card</item>
 | 
			
		||||
        <item name="android:layout_marginLeft">@dimen/card_margin</item>
 | 
			
		||||
        <item name="android:layout_marginRight">@dimen/card_margin</item>
 | 
			
		||||
        <item name="android:layout_marginTop">@dimen/card_margin</item>
 | 
			
		||||
        <item name="android:layout_marginBottom">@dimen/card_margin</item>
 | 
			
		||||
        <item name="cardElevation">3dp</item>
 | 
			
		||||
        <item name="cardUseCompatPadding">true</item>
 | 
			
		||||
        <item name="cardCornerRadius">2dp</item>
 | 
			
		||||
        <item name="android:layout_marginLeft">2dp</item>
 | 
			
		||||
        <item name="android:layout_marginRight">2dp</item>
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <style name="Theme.Widget.GridView">
 | 
			
		||||
 
 | 
			
		||||
@@ -84,6 +84,22 @@
 | 
			
		||||
        <!-- Attributes specific for SDK 16 to SDK 20 -->
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
    <!-- Amoled Theme -->
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
    <style name="Theme.Base.Amoled" parent="Theme.Base.Dark">
 | 
			
		||||
        <item name="android:colorBackground">@color/md_black_1000</item>
 | 
			
		||||
 | 
			
		||||
        <!-- Custom Attributes-->
 | 
			
		||||
        <item name="selectable_list_drawable">@drawable/list_item_selector_amoled</item>
 | 
			
		||||
        <item name="selectable_library_drawable">@drawable/library_item_selector_amoled</item>
 | 
			
		||||
        <item name="background_card">@color/md_black_1000</item>
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <style name="Theme.Tachiyomi.Amoled" parent="Theme.Base.Amoled">
 | 
			
		||||
        <!-- Attributes specific for SDK 16 to SDK 20 -->
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
    <!-- Reader Theme -->
 | 
			
		||||
    <!--==============-->
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user