mirror of
https://github.com/Ishan09811/pine.git
synced 2025-04-28 09:35:08 +00:00
Update MainActivity.kt
This commit is contained in:
parent
8a1051f4cf
commit
059f815f29
@ -188,20 +188,13 @@ class MainActivity : AppCompatActivity() {
|
||||
lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
||||
SkylineApplication.themeChangeFlow.distinctUntilChanged().collect { themeId ->
|
||||
if (getCurrentTheme() != themeId)
|
||||
recreate()
|
||||
recreate()
|
||||
}
|
||||
}
|
||||
}
|
||||
setInsets()
|
||||
}
|
||||
|
||||
private fun getCurrentTheme(): Int {
|
||||
val typedValue = TypedValue()
|
||||
this@MainActivity.theme.resolveAttribute(R.attr.theme, typedValue, true)
|
||||
return typedValue.resourceId
|
||||
}
|
||||
|
||||
private fun setAppListDecoration() {
|
||||
binding.appList.apply {
|
||||
while (itemDecorationCount > 0) removeItemDecorationAt(0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user