aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-10-19 22:54:05 -0700
committerAllan Wang <me@allanwang.ca>2019-10-19 22:54:05 -0700
commitcd93a1205a1f52883593288f0b0a5a5fb05b900b (patch)
treec36f2e18525eedd7e45e2e3a76188066880aa52a /kpref-activity/src
parentcd068b144ef533bccafc20b8b25ff72b56a93e23 (diff)
downloadkau-cd93a1205a1f52883593288f0b0a5a5fb05b900b.tar.gz
kau-cd93a1205a1f52883593288f0b0a5a5fb05b900b.tar.bz2
kau-cd93a1205a1f52883593288f0b0a5a5fb05b900b.zip
Fix status bar height for settings activity
Diffstat (limited to 'kpref-activity/src')
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt6
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