mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 03:01:49 +01:00
Move filter icon tint color to resources
This commit is contained in:
parent
a6c1de1cb2
commit
e77db309b8
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.library
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.graphics.Color
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
@ -39,6 +38,7 @@ import eu.kanade.tachiyomi.ui.base.controller.TabbedController
|
|||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||||
import eu.kanade.tachiyomi.ui.manga.MangaController
|
import eu.kanade.tachiyomi.ui.manga.MangaController
|
||||||
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import eu.kanade.tachiyomi.util.system.toast
|
import eu.kanade.tachiyomi.util.system.toast
|
||||||
import eu.kanade.tachiyomi.util.view.inflate
|
import eu.kanade.tachiyomi.util.view.inflate
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
@ -367,8 +367,10 @@ class LibraryController(
|
|||||||
val filterItem = menu.findItem(R.id.action_filter)
|
val filterItem = menu.findItem(R.id.action_filter)
|
||||||
|
|
||||||
// Tint icon if there's a filter active
|
// Tint icon if there's a filter active
|
||||||
val filterColor = if (navView.hasActiveFilters()) Color.rgb(255, 238, 7) else Color.WHITE
|
if (navView.hasActiveFilters()) {
|
||||||
DrawableCompat.setTint(filterItem.icon, filterColor)
|
val filterColor = activity!!.getResourceColor(R.attr.colorFilterActive)
|
||||||
|
DrawableCompat.setTint(filterItem.icon, filterColor)
|
||||||
|
}
|
||||||
|
|
||||||
// Display submenu
|
// Display submenu
|
||||||
if (preferences.libraryAsList().getOrDefault()) {
|
if (preferences.libraryAsList().getOrDefault()) {
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<attr name="selectable_library_drawable" format="reference|integer"/>
|
<attr name="selectable_library_drawable" format="reference|integer"/>
|
||||||
|
<attr name="colorFilterActive" format="reference|integer"/>
|
||||||
<attr name="colorBackgroundSplash" format="reference|integer"/>
|
<attr name="colorBackgroundSplash" format="reference|integer"/>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
<color name="pageNumberBackgroundLight">@color/md_grey_50_75</color>
|
<color name="pageNumberBackgroundLight">@color/md_grey_50_75</color>
|
||||||
<color name="pageNumberBackgroundDark">@color/md_grey_900_75</color>
|
<color name="pageNumberBackgroundDark">@color/md_grey_900_75</color>
|
||||||
|
|
||||||
|
<color name="filterColor">#FFEE07</color>
|
||||||
|
|
||||||
<!-- Text Colors -->
|
<!-- Text Colors -->
|
||||||
<color name="md_black_1000_87">#DE000000</color>
|
<color name="md_black_1000_87">#DE000000</color>
|
||||||
<color name="md_black_1000_54">#8A000000</color>
|
<color name="md_black_1000_54">#8A000000</color>
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
|
|
||||||
<!-- Custom Attributes-->
|
<!-- Custom Attributes-->
|
||||||
<item name="selectable_library_drawable">@drawable/library_item_selector_light</item>
|
<item name="selectable_library_drawable">@drawable/library_item_selector_light</item>
|
||||||
|
<item name="colorFilterActive">@color/filterColor</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!--===========-->
|
<!--===========-->
|
||||||
@ -122,6 +123,7 @@
|
|||||||
|
|
||||||
<!-- Custom Attributes-->
|
<!-- Custom Attributes-->
|
||||||
<item name="selectable_library_drawable">@drawable/library_item_selector_dark</item>
|
<item name="selectable_library_drawable">@drawable/library_item_selector_dark</item>
|
||||||
|
<item name="colorFilterActive">@color/filterColor</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Tachiyomi.Dark" parent="Theme.Base.Dark">
|
<style name="Theme.Tachiyomi.Dark" parent="Theme.Base.Dark">
|
||||||
|
Loading…
Reference in New Issue
Block a user