More theming

This commit is contained in:
Jay 2019-10-24 00:45:03 -07:00
parent c0e4b9bb38
commit 59a0d91679
6 changed files with 9 additions and 19 deletions

View File

@ -56,6 +56,11 @@ class MainActivity : BaseActivity() {
lateinit var tabAnimator: TabsAnimator
override fun onCreate(savedInstanceState: Bundle?) {
/*delegate.setLocalNightMode(when (preferences.theme()) {
1 -> MODE_NIGHT_NO
2, 3, 4 -> MODE_NIGHT_YES
else -> MODE_NIGHT_FOLLOW_SYSTEM
})*/
setDefaultNightMode(when (preferences.theme()) {
1 -> MODE_NIGHT_NO
2, 3, 4 -> MODE_NIGHT_YES
@ -73,7 +78,7 @@ class MainActivity : BaseActivity() {
finish()
return
}
//AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO)
setContentView(R.layout.main_activity)
setSupportActionBar(toolbar)

View File

@ -61,12 +61,7 @@ class SettingsGeneralController : SettingsController() {
defaultValue = "5"
summary = "%s"
onChange {newValue ->
AppCompatDelegate.setDefaultNightMode(when (newValue) {
"1" -> AppCompatDelegate.MODE_NIGHT_NO
"2", "3", "4" -> AppCompatDelegate.MODE_NIGHT_YES
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
})
onChange {
activity?.recreate()
true
}

View File

@ -16,7 +16,6 @@
<item name="android:listDivider">@drawable/line_divider_dark</item>
<!-- Themes -->
<item name="windowActionModeOverlay">true</item>
<item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Material</item>

View File

@ -23,7 +23,7 @@
<!--==============-->
<!-- Amoled Theme -->
<!--==============-->
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base.Amoled">
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base">
<!-- Attributes specific for SDK 21 and up -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>

View File

@ -19,7 +19,7 @@
<!--==============-->
<!-- Amoled Theme -->
<!--==============-->
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base.Amoled">
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base">
<!-- Attributes specific for SDK 21 and up -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>

View File

@ -58,15 +58,6 @@
<item name="android:colorBackground">@android:color/white</item>
</style>
<style name="Theme.Reader" parent="Theme.Base.Reader.Dark">
<!-- Attributes specific for SDK 16 to SDK 20 -->
</style>
<style name="Theme.Reader.Light" parent="Theme.Base.Reader.Light">
<!-- Attributes specific for SDK 16 to SDK 20 -->
</style>
<!--===============-->
<!-- Launch Screen -->
<!--===============-->