Initial AMOLED theme + some CardView fixes (#787)

* Initial AMOLED theme + some CardView fixes

* small fix
This commit is contained in:
Bram van de Kerkhof 2017-05-07 12:36:25 +02:00 committed by GitHub
parent 2eeac0bf8b
commit 2118434823
12 changed files with 100 additions and 5 deletions

View file

@ -32,6 +32,7 @@ interface ActivityMixin {
fun setAppTheme() { fun setAppTheme() {
setTheme(when (Injekt.get<PreferencesHelper>().theme()) { setTheme(when (Injekt.get<PreferencesHelper>().theme()) {
2 -> R.style.Theme_Tachiyomi_Dark 2 -> R.style.Theme_Tachiyomi_Dark
3 -> R.style.Theme_Tachiyomi_Amoled
else -> R.style.Theme_Tachiyomi else -> R.style.Theme_Tachiyomi
}) })
} }

View file

@ -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>

View 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>

View 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>

View 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>

View file

@ -9,6 +9,10 @@
android:id="@+id/recycler" android:id="@+id/recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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"> tools:listitem="@layout/item_recently_read">
</android.support.v7.widget.RecyclerView> </android.support.v7.widget.RecyclerView>

View file

@ -3,7 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cv_manga" android:id="@+id/cv_manga"
style="@style/Theme.Widget.CardView" style="@style/Theme.Widget.CardView"
android:layout_marginBottom="0dp"
> >
<LinearLayout <LinearLayout

View file

@ -20,6 +20,15 @@
<item name="android:navigationBarColor">@color/colorPrimaryDark</item> <item name="android:navigationBarColor">@color/colorPrimaryDark</item>
</style> </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 --> <!-- Reader Theme -->
<!--==============--> <!--==============-->

View file

@ -25,11 +25,13 @@
<string-array name="themes_values"> <string-array name="themes_values">
<item>1</item> <item>1</item>
<item>2</item> <item>2</item>
<item>3</item>
</string-array> </string-array>
<string-array name="themes"> <string-array name="themes">
<item>@string/light_theme</item> <item>@string/light_theme</item>
<item>@string/dark_theme</item> <item>@string/dark_theme</item>
<item>@string/amoled_theme</item>
</string-array> </string-array>
<string-array name="reader_themes"> <string-array name="reader_themes">

View file

@ -131,6 +131,7 @@
<string name="pref_theme">Application theme</string> <string name="pref_theme">Application theme</string>
<string name="light_theme">Main theme</string> <string name="light_theme">Main theme</string>
<string name="dark_theme">Dark 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_start_screen">Start screen</string>
<string name="pref_language">Language</string> <string name="pref_language">Language</string>
<string name="system_default">System default</string> <string name="system_default">System default</string>

View file

@ -147,10 +147,11 @@
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="cardBackgroundColor">?attr/background_card</item> <item name="cardBackgroundColor">?attr/background_card</item>
<item name="android:layout_marginLeft">@dimen/card_margin</item> <item name="cardElevation">3dp</item>
<item name="android:layout_marginRight">@dimen/card_margin</item> <item name="cardUseCompatPadding">true</item>
<item name="android:layout_marginTop">@dimen/card_margin</item> <item name="cardCornerRadius">2dp</item>
<item name="android:layout_marginBottom">@dimen/card_margin</item> <item name="android:layout_marginLeft">2dp</item>
<item name="android:layout_marginRight">2dp</item>
</style> </style>
<style name="Theme.Widget.GridView"> <style name="Theme.Widget.GridView">

View file

@ -84,6 +84,22 @@
<!-- Attributes specific for SDK 16 to SDK 20 --> <!-- Attributes specific for SDK 16 to SDK 20 -->
</style> </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 --> <!-- Reader Theme -->
<!--==============--> <!--==============-->