Merge light and dark themes (#5470)

* Merge AMOLED and regular dark themes

This allows all variants of dark themes to use black backgrounds as a
separate preference.

* Merge light and dark themes

* Fix ReaderSeekBar color on Dark Blue theme

* Color fixes

* Fix Dark Blue bars ripple

* Simplify night mode check
This commit is contained in:
Ivan Iskandar
2021-07-02 19:44:04 +07:00
committed by GitHub
parent 82f3677168
commit 0eadc028b6
71 changed files with 408 additions and 785 deletions
@@ -25,10 +25,8 @@ import com.google.android.material.elevation.ElevationOverlayProvider
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
import com.google.android.material.snackbar.Snackbar
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.util.system.getResourceColor
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import eu.kanade.tachiyomi.util.system.isNightMode
/**
* Returns coordinates of view.
@@ -186,7 +184,7 @@ inline fun ChipGroup.setChips(
* Applies elevation overlay to a MaterialCardView
*/
inline fun MaterialCardView.applyElevationOverlay() {
if (Injekt.get<PreferencesHelper>().isDarkMode()) {
if (context.isNightMode()) {
val provider = ElevationOverlayProvider(context)
setCardBackgroundColor(provider.compositeOverlay(cardBackgroundColor.defaultColor, cardElevation))
}