From 75cb94b51a4b52068a2ec7516c9cef8fc063d15f Mon Sep 17 00:00:00 2001 From: Bram van de Kerkhof Date: Wed, 30 Aug 2017 21:50:19 +0200 Subject: [PATCH] Fix tint on AMOLED theme (#966) Fix tint on AMOLED theme --- .../eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt | 5 +++++ .../tachiyomi/ui/recent_updates/RecentChapterHolder.kt | 4 ++++ app/src/main/res/layout/recent_chapters_item.xml | 4 ++-- app/src/main/res/values/attrs.xml | 1 + app/src/main/res/values/colors.xml | 3 +++ app/src/main/res/values/themes.xml | 2 ++ 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt index b5ef25f1a..936763bf7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt @@ -6,7 +6,9 @@ import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.download.model.Download +import eu.kanade.tachiyomi.util.getResourceColor import eu.kanade.tachiyomi.util.gone +import eu.kanade.tachiyomi.util.setVectorCompat import kotlinx.android.synthetic.main.chapters_item.view.* import java.util.* @@ -33,6 +35,9 @@ class ChapterHolder( else -> chapter.name } + // Set the correct drawable for dropdown and update the tint to match theme. + view.chapter_menu.setVectorCompat(R.drawable.ic_more_horiz_black_24dp, view.context.getResourceColor(R.attr.icon_color)) + // Set correct text color chapter_title.setTextColor(if (chapter.read) adapter.readColor else adapter.unreadColor) if (chapter.bookmark) chapter_title.setTextColor(adapter.bookmarkedColor) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt index 434ee400c..0c3a1f030 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt @@ -8,6 +8,7 @@ import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.setVectorCompat import jp.wasabeef.glide.transformations.CropCircleTransformation import kotlinx.android.synthetic.main.recent_chapters_item.view.* @@ -63,6 +64,9 @@ class RecentChapterHolder(private val view: View, private val adapter: RecentCha // Set manga title view.manga_title.text = item.manga.title + // Set the correct drawable for dropdown and update the tint to match theme. + view.chapter_menu_icon.setVectorCompat(R.drawable.ic_more_horiz_black_24dp, view.context.getResourceColor(R.attr.icon_color)) + // Set cover Glide.clear(itemView.manga_cover) if (!item.manga.thumbnail_url.isNullOrEmpty()) { diff --git a/app/src/main/res/layout/recent_chapters_item.xml b/app/src/main/res/layout/recent_chapters_item.xml index 9a23c8b37..2bf1b92d8 100644 --- a/app/src/main/res/layout/recent_chapters_item.xml +++ b/app/src/main/res/layout/recent_chapters_item.xml @@ -76,12 +76,12 @@ app:layout_constraintTop_toTopOf="parent"> + android:layout_marginRight="16dp" /> diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 3d4b09c75..3d0864a35 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -25,4 +25,5 @@ + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 8aa48821c..dff91d05c 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -20,6 +20,7 @@ @color/md_white_1000 @color/md_blue_A400_38 + @color/md_black_1000 #3399ff @@ -35,6 +36,7 @@ @color/md_grey_800 @color/md_blue_A200_50 + @color/md_white_1000_54 @color/md_grey_50_75 @@ -48,6 +50,7 @@ #FFFFFFFF #B3FFFFFF + #8AFFFFFF #80FFFFFF #33FFFFFF #1FFFFFFF diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 8a82972a3..ebe215a1e 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -36,6 +36,7 @@ @drawable/library_item_selector_light @color/textColorPrimaryLight @color/dialogLight + @color/iconColorLight