More updates to theme color logic

Using attr in more places
This commit is contained in:
Jays2Kings 2021-04-10 16:13:01 -04:00
parent bc5118d9cf
commit 65548c95a2
8 changed files with 15 additions and 15 deletions

View File

@ -63,7 +63,7 @@ class CategoryHolder(view: View, val adapter: CategoryAdapter) : BaseFlexibleVie
binding.editText.setText("") binding.editText.setText("")
binding.editText.hint = binding.title.text binding.editText.hint = binding.title.text
} else { } else {
binding.title.setTextColor(ContextCompat.getColor(itemView.context, R.color.textColorPrimary)) binding.title.setTextColor(itemView.context.getResourceColor(android.R.attr.textColorPrimary))
regularDrawable = ContextCompat.getDrawable( regularDrawable = ContextCompat.getDrawable(
itemView.context, itemView.context,
R.drawable R.drawable

View File

@ -10,6 +10,7 @@ import eu.kanade.tachiyomi.ui.manga.chapter.ChapterItem
import eu.kanade.tachiyomi.util.system.contextCompatColor import eu.kanade.tachiyomi.util.system.contextCompatColor
import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.dpToPx
import eu.kanade.tachiyomi.util.system.dpToPxEnd import eu.kanade.tachiyomi.util.system.dpToPxEnd
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.system.timeSpanFromNow import eu.kanade.tachiyomi.util.system.timeSpanFromNow
class ChapterUtil { class ChapterUtil {
@ -85,9 +86,9 @@ class ChapterUtil {
private fun readColor(context: Context): Int = context.contextCompatColor(R.color.read_chapter) private fun readColor(context: Context): Int = context.contextCompatColor(R.color.read_chapter)
private fun unreadColor(context: Context): Int = context.contextCompatColor(R.color.unread_chapter) private fun unreadColor(context: Context): Int = context.getResourceColor(android.R.attr.textColorPrimary)
private fun bookmarkedColor(context: Context): Int = context.contextCompatColor(R.color.bookmarked_chapter) private fun bookmarkedColor(context: Context): Int = context.getResourceColor(android.R.attr.colorAccent)
private val volumeRegex = Regex("""(vol|volume)\.? *([0-9]+)?""", RegexOption.IGNORE_CASE) private val volumeRegex = Regex("""(vol|volume)\.? *([0-9]+)?""", RegexOption.IGNORE_CASE)
private val seasonRegex = Regex("""(Season |S)([0-9]+)?""") private val seasonRegex = Regex("""(Season |S)([0-9]+)?""")

View File

@ -53,7 +53,7 @@
android:inputType="textCapSentences" android:inputType="textCapSentences"
android:maxLines="1" android:maxLines="1"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@id/title" app:layout_constraintEnd_toEndOf="@id/title"
app:layout_constraintTop_toTopOf="@id/title" app:layout_constraintTop_toTopOf="@id/title"
@ -69,7 +69,7 @@
android:layout_marginStart="3dp" android:layout_marginStart="3dp"
android:inputType="none" android:inputType="none"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@id/edit_button" app:layout_constraintEnd_toStartOf="@id/edit_button"
app:layout_constraintStart_toEndOf="@id/image" app:layout_constraintStart_toEndOf="@id/image"

View File

@ -22,7 +22,7 @@
android:id="@+id/read" android:id="@+id/read"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:tint="@color/md_white_1000" app:tint="@color/md_white_1000"
android:layout_gravity="end|center" android:layout_gravity="end|center"
android:layout_marginEnd="21dp" android:layout_marginEnd="21dp"
android:src="@drawable/ic_read_24dp" /> android:src="@drawable/ic_read_24dp" />
@ -34,7 +34,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" android:visibility="gone"
android:background="@color/colorAccent" android:background="?colorAccent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -46,7 +46,7 @@
android:layout_height="24dp" android:layout_height="24dp"
android:layout_gravity="start|center" android:layout_gravity="start|center"
android:layout_marginStart="21dp" android:layout_marginStart="21dp"
android:tint="@color/md_white_1000" app:tint="@color/md_white_1000"
android:src="@drawable/ic_bookmark_24dp" /> android:src="@drawable/ic_bookmark_24dp" />
</FrameLayout> </FrameLayout>

View File

@ -34,6 +34,7 @@
<eu.kanade.tachiyomi.ui.base.CenteredToolbar <eu.kanade.tachiyomi.ui.base.CenteredToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
app:titleTextColor="?actionBarTintColor"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorSecondary"> android:background="?attr/colorSecondary">

View File

@ -14,8 +14,6 @@
<color name="gray_button">#404040</color> <color name="gray_button">#404040</color>
<color name="read_chapter">@color/text_color_hint</color> <color name="read_chapter">@color/text_color_hint</color>
<color name="unread_chapter">@color/textColorPrimary</color>
<color name="bookmarked_chapter">@color/colorAccent</color>
<color name="unread_badge">@color/colorAccent</color> <color name="unread_badge">@color/colorAccent</color>
<color name="unread_badge_text">@color/md_white_1000</color> <color name="unread_badge_text">@color/md_white_1000</color>

View File

@ -53,7 +53,7 @@
</style> </style>
<style name="TextAppearance.Regular.Body1.Light"> <style name="TextAppearance.Regular.Body1.Light">
<item name="android:textColor">@color/textColorPrimary</item> <item name="android:textColor">?android:attr/textColorPrimary</item>
</style> </style>
<style name="TextAppearance.Regular.Body1.Secondary"> <style name="TextAppearance.Regular.Body1.Secondary">
@ -65,7 +65,7 @@
</style> </style>
<style name="TextAppearance.Regular.Caption.Light"> <style name="TextAppearance.Regular.Caption.Light">
<item name="android:textColor">@color/textColorPrimary</item> <item name="android:textColor">?android:attr/textColorPrimary</item>
</style> </style>
<style name="TextAppearance.Regular.Caption.Hint"> <style name="TextAppearance.Regular.Caption.Hint">
@ -81,7 +81,7 @@
</style> </style>
<style name="TextAppearance.Regular.SubHeading.Light"> <style name="TextAppearance.Regular.SubHeading.Light">
<item name="android:textColor">@color/textColorPrimary</item> <item name="android:textColor">?android:attr/textColorPrimary</item>
</style> </style>
<style name="TextAppearance.Regular.SubHeading.Light.Bold"> <style name="TextAppearance.Regular.SubHeading.Light.Bold">

View File

@ -36,7 +36,7 @@
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<!-- Custom Attributes--> <!-- Custom Attributes-->
<item name="actionBarTintColor">@color/textColorPrimary</item> <item name="actionBarTintColor">?android:textColorPrimary</item>
<item name="tabBarIconColor">?colorAccent</item> <item name="tabBarIconColor">?colorAccent</item>
<item name="tabBarIconInactive">@color/colorPrimaryInactive</item> <item name="tabBarIconInactive">@color/colorPrimaryInactive</item>
<item name="android:statusBarColor">@color/status_bar</item> <item name="android:statusBarColor">@color/status_bar</item>
@ -45,7 +45,7 @@
<item name="tabHighlightBackground">@color/accent_alpha</item> <item name="tabHighlightBackground">@color/accent_alpha</item>
<!-- Material Dialog colors --> <!-- Material Dialog colors -->
<item name="md_color_title">@color/textColorPrimary</item> <item name="md_color_title">?android:attr/textColorPrimary</item>
<item name="md_color_content">@color/text_color_secondary</item> <item name="md_color_content">@color/text_color_secondary</item>
<item name="md_color_button_text">?colorAccent</item> <item name="md_color_button_text">?colorAccent</item>
<item name="md_background_color">@color/dialog</item> <item name="md_background_color">@color/dialog</item>