fix window insets after granting permissions
This commit is contained in:
parent
815287b9b2
commit
5085a1388d
|
@ -82,7 +82,6 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
|||
super.onCreate(savedInstanceState)
|
||||
appLaunched(BuildConfig.APPLICATION_ID)
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
|
||||
initVariables()
|
||||
tryInitCamera()
|
||||
|
@ -298,6 +297,7 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
|||
defaultScene = Scene(top_options, default_icons)
|
||||
flashModeScene = Scene(top_options, flash_toggle_group)
|
||||
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
ViewCompat.setOnApplyWindowInsetsListener(view_holder) { _, windowInsets ->
|
||||
val safeInsetBottom = windowInsets.displayCutout?.safeInsetBottom ?: 0
|
||||
val safeInsetTop = windowInsets.displayCutout?.safeInsetTop ?: 0
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:background="@android:color/black"
|
||||
android:fitsSystemWindows="true">
|
||||
android:background="@android:color/black">
|
||||
|
||||
<androidx.camera.view.PreviewView
|
||||
android:id="@+id/preview_view"
|
||||
|
|
Loading…
Reference in New Issue