Fix theme issue related to system default
This commit is contained in:
@@ -44,7 +44,7 @@ fun Fragment.applyTheme(
|
|||||||
) {
|
) {
|
||||||
val themeStyle = CommonUtil.getThemeStyleById(themeId)
|
val themeStyle = CommonUtil.getThemeStyleById(themeId)
|
||||||
|
|
||||||
if (themeStyle == 0) {
|
if (themeId == 0) {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||||
(requireActivity() as AppCompatActivity).applyDayNightMask()
|
(requireActivity() as AppCompatActivity).applyDayNightMask()
|
||||||
} else {
|
} else {
|
||||||
@@ -77,7 +77,7 @@ fun AppCompatActivity.applyTheme(themeId: Int, accentId: Int = 1) {
|
|||||||
val themeStyle = CommonUtil.getThemeStyleById(themeId)
|
val themeStyle = CommonUtil.getThemeStyleById(themeId)
|
||||||
val accentStyle = CommonUtil.getAccentStyleById(accentId)
|
val accentStyle = CommonUtil.getAccentStyleById(accentId)
|
||||||
|
|
||||||
if (themeStyle == 0) {
|
if (themeId == 0) {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||||
applyDayNightMask()
|
applyDayNightMask()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user