0
0
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:
Ishan09811 2025-01-03 12:14:36 +05:30 committed by GitHub
parent 8a1051f4cf
commit 059f815f29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)