From 21cc5a6a6f8ac45b80a61f66c73d2729402fbe14 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 22 Feb 2020 00:33:58 -0800 Subject: [PATCH] Use black background for AMOLED theme cards, dialogs Fixed layout of catalouge grid itesm Co-Authored-By: arkon --- .../ui/catalogue/browse/CatalogueGridHolder.kt | 6 ------ .../ui/catalogue/browse/CatalogueItem.kt | 2 ++ .../tachiyomi/util/view/ViewExtensions.kt | 18 +++++++++++------- app/src/main/res/values-night/themes.xml | 4 ++-- app/src/main/res/values/colors.xml | 1 - 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt index 62ce45198f..cf3fac6e5d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt @@ -7,13 +7,9 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible -import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.library.LibraryCategoryAdapter -import eu.kanade.tachiyomi.util.system.dpToPx -import eu.kanade.tachiyomi.util.view.gone -import eu.kanade.tachiyomi.util.view.updatePaddingRelative import eu.kanade.tachiyomi.widget.StateImageViewTarget import kotlinx.android.synthetic.main.catalogue_grid_item.* import kotlinx.android.synthetic.main.unread_download_badge.* @@ -40,8 +36,6 @@ class CatalogueGridHolder( */ override fun onSetValues(manga: Manga) { // Update the title of the manga. - subtitle.gone() - title.gone() compact_title.text = manga.currentTitle() badge_view.setInLibrary(manga.favorite) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt index 81e1faffa8..a1be6d6285 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt @@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.util.system.dpToPx +import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.catalogue_grid_item.view.* @@ -37,6 +38,7 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference Unit)? = null): Snackbar { val snack = Snackbar.make(this, message, length) - val theme = Injekt.get().theme() - if (theme == 3 || theme == 6) { - val textView: TextView = - snack.view.findViewById(com.google.android.material.R.id.snackbar_text) - textView.setTextColor(context.getResourceColor(R.attr.snackbar_text)) - snack.config(context) - } /* when { Build.VERSION.SDK_INT >= 23 -> { val leftM = if (this is CoordinatorLayout) 0 else rootWindowInsets.systemWindowInsetLeft @@ -70,6 +64,16 @@ Unit)? = null): Snackbar { if (f != null) { snack.f() } + val theme = Injekt.get().theme() + if (theme == 3 || theme == 6) { + val textView: TextView = + snack.view.findViewById(com.google.android.material.R.id.snackbar_text) + val button: Button? = + snack.view.findViewById(com.google.android.material.R.id.snackbar_action) + textView.setTextColor(context.getResourceColor(R.attr.snackbar_text)) + button?.setTextColor(context.getResourceColor(R.attr.snackbar_text)) + snack.config(context) + } // if (Build.VERSION.SDK_INT < 23) { /* val view = if (this !is CoordinatorLayout) this else snack.view view.doOnApplyWindowInsets { _, insets, _ -> diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 82788cb292..ca30343c9f 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -33,14 +33,14 @@ @drawable/list_item_selector @drawable/library_item_selector_amoled - @color/dialog_amoled + @color/colorAmoledPrimary @color/textColorPrimary @color/textColorSecondary @color/colorAccent - @color/dialog_amoled + @color/colorAmoledPrimary 16dp \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 38d3fa5d6d..bc94325892 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -19,7 +19,6 @@ @color/md_black_1000_38 @color/md_black_1000 - @color/darkPrimaryColor #212121 #1C1C1D @color/md_white_1000