diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index a05568da51..66a86b2b49 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -15,6 +15,7 @@ import android.view.ViewGroup import android.webkit.WebView import android.widget.FrameLayout import android.widget.TextView +import androidx.appcompat.content.res.AppCompatResources import androidx.appcompat.graphics.drawable.DrawerArrowDrawable import androidx.biometric.BiometricManager import androidx.core.graphics.ColorUtils @@ -331,12 +332,9 @@ open class MainActivity : BaseActivity() { fun updateRecentsIcon() { if (bottomNav) navigationView.menu.findItem(R.id.nav_drawer_recents).icon = - VectorDrawableCompat.create( - resources!!, + AppCompatResources.getDrawable(this, if (preferences.showRecentUpdates().getOrDefault()) R.drawable.ic_update_black_24dp - else R.drawable.ic_history_black_24dp, - null - ) + else R.drawable.ic_history_black_24dp) } override fun startSupportActionMode(callback: androidx.appcompat.view.ActionMode.Callback): androidx.appcompat.view.ActionMode? { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt index 5119a76106..b152abe7bf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt @@ -14,6 +14,7 @@ import android.view.ViewGroup import android.webkit.WebChromeClient import android.webkit.WebView import android.widget.LinearLayout +import androidx.core.content.ContextCompat import androidx.core.graphics.ColorUtils import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.SourceManager @@ -104,19 +105,22 @@ class WebViewActivity : BaseActivity() { } content.setOnApplyWindowInsetsListener { v, insets -> - window.statusBarColor = getResourceColor(R.attr.colorPrimary) - window.navigationBarColor = - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { - v.context.getResourceColor(android.R.attr.colorPrimary) - } - // if the android q+ device has gesture nav, transparent nav bar - else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q - && (v.rootWindowInsets.systemWindowInsetBottom != v.rootWindowInsets - .tappableElementInsets.bottom)) { - getColor(android.R.color.transparent) - } else { - v.context.getResourceColor(android.R.attr.colorBackground) - } + // if pure white theme on a device that does not support dark status bar + if (getResourceColor(android.R.attr.statusBarColor) != Color.TRANSPARENT) + window.statusBarColor = Color.BLACK + else window.statusBarColor = getResourceColor(R.attr.colorPrimary) + window.navigationBarColor = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { + val colorPrimary = getResourceColor(android.R.attr.colorPrimary) + if (colorPrimary == Color.WHITE) Color.BLACK + else getResourceColor(android.R.attr.colorPrimary) + } + // if the android q+ device has gesture nav, transparent nav bar + else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && + (v.rootWindowInsets.systemWindowInsetBottom != v.rootWindowInsets.tappableElementInsets.bottom)) { + getColor(android.R.color.transparent) + } else { + getResourceColor(android.R.attr.colorBackground) + } v.setPadding(insets.systemWindowInsetLeft, insets.systemWindowInsetTop, insets.systemWindowInsetRight, 0) val currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK diff --git a/app/src/main/res/values-v23/themes.xml b/app/src/main/res/values-v23/themes.xml new file mode 100644 index 0000000000..311df89ac6 --- /dev/null +++ b/app/src/main/res/values-v23/themes.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4455254bf3..8e63682041 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -134,15 +134,15 @@ App theme - Light + Light Blue Dark AMOLED dark Dark blue System default (Light + Dark) Pure White System default (White + Dark) - System default (Light + AMOLED dark) - System default (Light + Dark blue) + System default (Light + AMOLED) + System default (All blue) Start screen Language System default @@ -549,12 +549,12 @@ For %d titles - and %1$d more chapter. - and %1$d more chapters. + and %1$d more chapter + and %1$d more chapters - and %1$d more extension. - and %1$d more extensions. + and %1$d more extension + and %1$d more extensions Failed to update cover Please add the manga to your library before doing this diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index ada3142326..078be0da61 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -67,6 +67,7 @@ @style/ThemeOverlay.AppCompat.DayNight.ActionBar @color/colorPrimary @color/colorPrimaryInactive + @color/md_black_1000_54 @color/colorAccent