diff options
author | Allan Wang <me@allanwang.ca> | 2019-10-19 22:54:05 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-10-19 22:54:05 -0700 |
commit | cd93a1205a1f52883593288f0b0a5a5fb05b900b (patch) | |
tree | c36f2e18525eedd7e45e2e3a76188066880aa52a | |
parent | cd068b144ef533bccafc20b8b25ff72b56a93e23 (diff) | |
download | kau-cd93a1205a1f52883593288f0b0a5a5fb05b900b.tar.gz kau-cd93a1205a1f52883593288f0b0a5a5fb05b900b.tar.bz2 kau-cd93a1205a1f52883593288f0b0a5a5fb05b900b.zip |
Fix status bar height for settings activity
-rw-r--r-- | kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt index 800a355..25f94c5 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt @@ -28,7 +28,9 @@ import ca.allanwang.kau.kpref.activity.items.KPrefItemCore import ca.allanwang.kau.ui.views.RippleCanvas import ca.allanwang.kau.utils.KAU_LEFT import ca.allanwang.kau.utils.KAU_RIGHT +import ca.allanwang.kau.utils.contentView import ca.allanwang.kau.utils.resolveColor +import ca.allanwang.kau.utils.setMarginTop import ca.allanwang.kau.utils.statusBarColor import ca.allanwang.kau.utils.withLinearAdapter import com.mikepenz.fastadapter.adapters.FastItemAdapter @@ -83,6 +85,10 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { toolbar.setNavigationOnClickListener { onBackPressed() } setDisplayShowTitleEnabled(false) } + findViewById<View>(android.R.id.content).setOnApplyWindowInsetsListener { _, insets -> + kau_toolbar.setMarginTop(insets.systemWindowInsetTop) + insets + } window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN statusBarColor = 0x30000000 |