Added white theme to pref
This commit is contained in:
parent
25df36c60d
commit
f24fefad59
@ -20,7 +20,7 @@ abstract class BaseActivity : AppCompatActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
AppCompatDelegate.setDefaultNightMode(
|
AppCompatDelegate.setDefaultNightMode(
|
||||||
when (preferences.theme()) {
|
when (preferences.theme()) {
|
||||||
1 -> AppCompatDelegate.MODE_NIGHT_NO
|
1, 8 -> AppCompatDelegate.MODE_NIGHT_NO
|
||||||
2, 3, 4 -> AppCompatDelegate.MODE_NIGHT_YES
|
2, 3, 4 -> AppCompatDelegate.MODE_NIGHT_YES
|
||||||
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||||
}
|
}
|
||||||
@ -28,6 +28,7 @@ abstract class BaseActivity : AppCompatActivity() {
|
|||||||
setTheme(when (preferences.theme()) {
|
setTheme(when (preferences.theme()) {
|
||||||
3, 6 -> R.style.Theme_Tachiyomi_Amoled
|
3, 6 -> R.style.Theme_Tachiyomi_Amoled
|
||||||
4, 7 -> R.style.Theme_Tachiyomi_DarkBlue
|
4, 7 -> R.style.Theme_Tachiyomi_DarkBlue
|
||||||
|
8, 9 -> R.style.Theme_Tachiyomi_MatWhite
|
||||||
else -> R.style.Theme_Tachiyomi
|
else -> R.style.Theme_Tachiyomi
|
||||||
})
|
})
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -215,25 +215,29 @@ open class MainActivity : BaseActivity() {
|
|||||||
getColor(android.R.color.transparent)
|
getColor(android.R.color.transparent)
|
||||||
}
|
}
|
||||||
// if in landscape with 2/3 button mode, fully opaque nav bar
|
// if in landscape with 2/3 button mode, fully opaque nav bar
|
||||||
else if (v.rootWindowInsets.systemWindowInsetLeft > 0
|
else {/*if (v.rootWindowInsets.systemWindowInsetLeft > 0
|
||||||
|| v.rootWindowInsets.systemWindowInsetRight > 0) {
|
|| v.rootWindowInsets.systemWindowInsetRight > 0) {*/
|
||||||
getResourceColor(android.R.attr.colorBackground)
|
getResourceColor(android.R.attr.colorPrimary)
|
||||||
}
|
}
|
||||||
// if in portrait with 2/3 button mode, translucent nav bar
|
// if in portrait with 2/3 button mode, translucent nav bar
|
||||||
else {
|
/* else {
|
||||||
ColorUtils.setAlphaComponent(
|
ColorUtils.setAlphaComponent(
|
||||||
getResourceColor(android.R.attr.colorBackground), 179)
|
getResourceColor(android.R.attr.colorPrimary), 179)
|
||||||
}
|
}*/
|
||||||
v.setPadding(insets.systemWindowInsetLeft, insets.systemWindowInsetTop,
|
v.setPadding(insets.systemWindowInsetLeft, insets.systemWindowInsetTop,
|
||||||
insets.systemWindowInsetRight, 0)
|
insets.systemWindowInsetRight, 0)
|
||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
val currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
|
val currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
|
||||||
if (Build.VERSION.SDK_INT >= 26 && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
|
if (Build.VERSION.SDK_INT >= 26 && currentNightMode == Configuration.UI_MODE_NIGHT_NO &&
|
||||||
content.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
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) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && currentNightMode == Configuration
|
||||||
// content.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
.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)
|
val drawerContainer: FrameLayout = findViewById(R.id.drawer_container)
|
||||||
drawerContainer.setOnApplyWindowInsetsListener { v, insets ->
|
drawerContainer.setOnApplyWindowInsetsListener { v, insets ->
|
||||||
@ -330,7 +334,7 @@ open class MainActivity : BaseActivity() {
|
|||||||
else {
|
else {
|
||||||
extUpdateText.text = null
|
extUpdateText.text = null
|
||||||
extUpdateText.gone()
|
extUpdateText.gone()
|
||||||
navigationView.getOrCreateBadge(R.id.nav_drawer_settings).clearNumber()
|
navigationView.removeBadge(R.id.nav_drawer_settings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ class MangaController : RxController, TabbedController {
|
|||||||
VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null)
|
VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null)
|
||||||
else null
|
else null
|
||||||
|
|
||||||
tab.icon = drawable
|
//tab.icon = drawable
|
||||||
}
|
}
|
||||||
|
|
||||||
private inner class MangaDetailAdapter : RouterPagerAdapter(this@MangaController) {
|
private inner class MangaDetailAdapter : RouterPagerAdapter(this@MangaController) {
|
||||||
|
@ -44,10 +44,11 @@ class SettingsGeneralController : SettingsController() {
|
|||||||
intListPreference(activity) {
|
intListPreference(activity) {
|
||||||
key = Keys.theme
|
key = Keys.theme
|
||||||
titleRes = R.string.pref_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.amoled_theme, R.string.darkblue_theme,
|
||||||
R.string.system_theme, R.string.system_amoled_theme, R.string.system_darkblue_theme)
|
R.string.system_theme, R.string.sysyem_white_theme, R.string.system_amoled_theme, R.string
|
||||||
entryRange = 1..7
|
.system_darkblue_theme)
|
||||||
|
entryValues = listOf(1, 8, 2, 3, 4, 5, 9, 6, 7)
|
||||||
defaultValue = 5
|
defaultValue = 5
|
||||||
|
|
||||||
onChange {
|
onChange {
|
||||||
|
@ -122,6 +122,9 @@ class WebViewActivity : BaseActivity() {
|
|||||||
if (Build.VERSION.SDK_INT >= 26 && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
|
if (Build.VERSION.SDK_INT >= 26 && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
|
||||||
content.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
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
|
insets
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,6 +209,9 @@ class WebViewActivity : BaseActivity() {
|
|||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/Theme.ActionBar.Tab"
|
android:theme="@style/Theme.ActionBar.Tab"
|
||||||
app:tabBackground="?colorPrimary"
|
android:background="?colorPrimary"
|
||||||
|
app:tabRippleColor="@color/rippleColor"
|
||||||
app:tabIndicatorColor="?attr/tabBarIconColor"
|
app:tabIndicatorColor="?attr/tabBarIconColor"
|
||||||
app:tabTextColor="?attr/tabBarIconColor"
|
app:tabTextColor="?attr/tabBarIconColor"
|
||||||
app:tabInlineLabel="true"
|
app:tabInlineLabel="true"
|
||||||
|
@ -134,9 +134,11 @@
|
|||||||
<string name="dark_theme">Dark</string>
|
<string name="dark_theme">Dark</string>
|
||||||
<string name="amoled_theme">AMOLED dark</string>
|
<string name="amoled_theme">AMOLED dark</string>
|
||||||
<string name="darkblue_theme">Dark blue</string>
|
<string name="darkblue_theme">Dark blue</string>
|
||||||
<string name="system_theme">System default</string>
|
<string name="system_theme">System default (Light + Dark)</string>
|
||||||
<string name="system_amoled_theme">System default (AMOLED dark)</string>
|
<string name="white_theme">Pure White</string>
|
||||||
<string name="system_darkblue_theme">System default (Dark blue)</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_start_screen">Start screen</string>
|
||||||
<string name="pref_language">Language</string>
|
<string name="pref_language">Language</string>
|
||||||
<string name="system_default">System default</string>
|
<string name="system_default">System default</string>
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
<style name="CustomActionModeStyle" parent="Base.Widget.AppCompat.ActionMode">
|
<style name="CustomActionModeStyle" parent="Base.Widget.AppCompat.ActionMode">
|
||||||
<item name="background">@drawable/action_mode_bg</item>
|
<item name="background">@drawable/action_mode_bg</item>
|
||||||
<item name="android:tint">@color/red_error</item>
|
|
||||||
<item name="backgroundSplit">@color/red_error</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!--===========-->
|
<!--===========-->
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
<item name="actionModeStyle">@style/CustomActionModeStyle</item>
|
<item name="actionModeStyle">@style/CustomActionModeStyle</item>
|
||||||
<item name="tabBarIconColor">@color/md_white_1000</item>
|
<item name="tabBarIconColor">@color/md_white_1000</item>
|
||||||
<item name="tabBarIconInactive">@color/md_white_1000_76</item>
|
<item name="tabBarIconInactive">@color/md_white_1000_76</item>
|
||||||
<item name="colorControlHighlight">@color/rippleColor</item>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Themes -->
|
<!-- Themes -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user