diff --git a/storage/demo/src/main/java/de/grobox/storagebackuptester/MainActivity.kt b/storage/demo/src/main/java/de/grobox/storagebackuptester/MainActivity.kt index 3b9347db..5046d2a1 100644 --- a/storage/demo/src/main/java/de/grobox/storagebackuptester/MainActivity.kt +++ b/storage/demo/src/main/java/de/grobox/storagebackuptester/MainActivity.kt @@ -8,6 +8,11 @@ package de.grobox.storagebackuptester import android.os.Bundle import android.util.Log import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener +import androidx.core.view.WindowCompat.setDecorFitsSystemWindows +import androidx.core.view.WindowInsetsCompat.CONSUMED +import androidx.core.view.WindowInsetsCompat.Type.displayCutout +import androidx.core.view.WindowInsetsCompat.Type.systemBars import de.grobox.storagebackuptester.crypto.KeyManager class MainActivity : AppCompatActivity() { @@ -16,6 +21,13 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + setDecorFitsSystemWindows(window, false) + setOnApplyWindowInsetsListener(window.decorView.rootView) { v, windowInsets -> + val insets = windowInsets.getInsets(systemBars() or displayCutout()) + v.setPadding(insets.left, insets.top, insets.right, insets.bottom) + CONSUMED + } + if (savedInstanceState == null) { supportFragmentManager.beginTransaction() .replace(R.id.container, LogFragment.newInstance())