Added white theme to pref

This commit is contained in:
Jay 2020-02-01 02:47:25 -08:00
parent 25df36c60d
commit f24fefad59
9 changed files with 35 additions and 23 deletions

View File

@ -20,7 +20,7 @@ abstract class BaseActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
AppCompatDelegate.setDefaultNightMode(
when (preferences.theme()) {
1 -> AppCompatDelegate.MODE_NIGHT_NO
1, 8 -> AppCompatDelegate.MODE_NIGHT_NO
2, 3, 4 -> AppCompatDelegate.MODE_NIGHT_YES
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
}
@ -28,6 +28,7 @@ abstract class BaseActivity : AppCompatActivity() {
setTheme(when (preferences.theme()) {
3, 6 -> R.style.Theme_Tachiyomi_Amoled
4, 7 -> R.style.Theme_Tachiyomi_DarkBlue
8, 9 -> R.style.Theme_Tachiyomi_MatWhite
else -> R.style.Theme_Tachiyomi
})
super.onCreate(savedInstanceState)

View File

@ -215,25 +215,29 @@ open class MainActivity : BaseActivity() {
getColor(android.R.color.transparent)
}
// if in landscape with 2/3 button mode, fully opaque nav bar
else if (v.rootWindowInsets.systemWindowInsetLeft > 0
|| v.rootWindowInsets.systemWindowInsetRight > 0) {
getResourceColor(android.R.attr.colorBackground)
else {/*if (v.rootWindowInsets.systemWindowInsetLeft > 0
|| v.rootWindowInsets.systemWindowInsetRight > 0) {*/
getResourceColor(android.R.attr.colorPrimary)
}
// if in portrait with 2/3 button mode, translucent nav bar
else {
/* else {
ColorUtils.setAlphaComponent(
getResourceColor(android.R.attr.colorBackground), 179)
}
getResourceColor(android.R.attr.colorPrimary), 179)
}*/
v.setPadding(insets.systemWindowInsetLeft, insets.systemWindowInsetTop,
insets.systemWindowInsetRight, 0)
insets
}
val currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
if (Build.VERSION.SDK_INT >= 26 && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
content.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
if (Build.VERSION.SDK_INT >= 26 && currentNightMode == Configuration.UI_MODE_NIGHT_NO &&
preferences.theme() >= 8) {
content.systemUiVisibility = content.systemUiVisibility.or(View
.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR)
}
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
// content.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && currentNightMode == Configuration
.UI_MODE_NIGHT_NO && preferences.theme() >= 8)
content.systemUiVisibility = content.systemUiVisibility.or(View
.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
val drawerContainer: FrameLayout = findViewById(R.id.drawer_container)
drawerContainer.setOnApplyWindowInsetsListener { v, insets ->
@ -330,7 +334,7 @@ open class MainActivity : BaseActivity() {
else {
extUpdateText.text = null
extUpdateText.gone()
navigationView.getOrCreateBadge(R.id.nav_drawer_settings).clearNumber()
navigationView.removeBadge(R.id.nav_drawer_settings)
}
}

View File

@ -200,7 +200,7 @@ class MangaController : RxController, TabbedController {
VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null)
else null
tab.icon = drawable
//tab.icon = drawable
}
private inner class MangaDetailAdapter : RouterPagerAdapter(this@MangaController) {

View File

@ -44,10 +44,11 @@ class SettingsGeneralController : SettingsController() {
intListPreference(activity) {
key = Keys.theme
titleRes = R.string.pref_theme
entriesRes = arrayOf(R.string.light_theme, R.string.dark_theme,
entriesRes = arrayOf(R.string.light_theme, R.string.white_theme, R.string.dark_theme,
R.string.amoled_theme, R.string.darkblue_theme,
R.string.system_theme, R.string.system_amoled_theme, R.string.system_darkblue_theme)
entryRange = 1..7
R.string.system_theme, R.string.sysyem_white_theme, R.string.system_amoled_theme, R.string
.system_darkblue_theme)
entryValues = listOf(1, 8, 2, 3, 4, 5, 9, 6, 7)
defaultValue = 5
onChange {

View File

@ -122,6 +122,9 @@ class WebViewActivity : BaseActivity() {
if (Build.VERSION.SDK_INT >= 26 && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
content.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && currentNightMode == Configuration
.UI_MODE_NIGHT_NO && preferences.theme() >= 8)
content.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
insets
}
@ -206,6 +209,9 @@ class WebViewActivity : BaseActivity() {
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && currentNightMode == Configuration
.UI_MODE_NIGHT_NO && preferences.theme() >= 8)
web_linear_layout.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
}
/**

View File

@ -41,7 +41,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.ActionBar.Tab"
app:tabBackground="?colorPrimary"
android:background="?colorPrimary"
app:tabRippleColor="@color/rippleColor"
app:tabIndicatorColor="?attr/tabBarIconColor"
app:tabTextColor="?attr/tabBarIconColor"
app:tabInlineLabel="true"

View File

@ -134,9 +134,11 @@
<string name="dark_theme">Dark</string>
<string name="amoled_theme">AMOLED dark</string>
<string name="darkblue_theme">Dark blue</string>
<string name="system_theme">System default</string>
<string name="system_amoled_theme">System default (AMOLED dark)</string>
<string name="system_darkblue_theme">System default (Dark blue)</string>
<string name="system_theme">System default (Light + Dark)</string>
<string name="white_theme">Pure White</string>
<string name="sysyem_white_theme">System default (White + Dark)</string>
<string name="system_amoled_theme">System default (Light + AMOLED dark)</string>
<string name="system_darkblue_theme">System default (Light + Dark blue)</string>
<string name="pref_start_screen">Start screen</string>
<string name="pref_language">Language</string>
<string name="system_default">System default</string>

View File

@ -16,8 +16,6 @@
<style name="CustomActionModeStyle" parent="Base.Widget.AppCompat.ActionMode">
<item name="background">@drawable/action_mode_bg</item>
<item name="android:tint">@color/red_error</item>
<item name="backgroundSplit">@color/red_error</item>
</style>
<!--===========-->

View File

@ -25,7 +25,6 @@
<item name="actionModeStyle">@style/CustomActionModeStyle</item>
<item name="tabBarIconColor">@color/md_white_1000</item>
<item name="tabBarIconInactive">@color/md_white_1000_76</item>
<item name="colorControlHighlight">@color/rippleColor</item>
<!-- Themes -->