mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
make preview fill up to the cutoff (notch)
- add theme attribute android:windowLayoutInDisplayCutoutMode to shortEdges in the theme - add flags FLAG_LAYOUT_NO_LIMITS to the window flags - add top margin to the icons on top, set to the statusBarHeight - add bottom margin to the icons at the bottom, set to the navigationBarHeight + view margin
This commit is contained in:
@ -64,16 +64,21 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
||||
setShowWhenLocked(true)
|
||||
setTurnScreenOn(true)
|
||||
window.insetsController?.hide(WindowInsets.Type.statusBars())
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
|
||||
} else if (isOreoMr1Plus()) {
|
||||
setShowWhenLocked(true)
|
||||
setTurnScreenOn(true)
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
||||
window.addFlags(
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN or
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
)
|
||||
} else {
|
||||
window.addFlags(
|
||||
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or
|
||||
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
|
||||
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON or
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN or
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -214,6 +219,16 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
||||
setContentView(R.layout.activity_main)
|
||||
initButtons()
|
||||
|
||||
(toggle_photo_video.layoutParams as ConstraintLayout.LayoutParams).setMargins(
|
||||
0,
|
||||
statusBarHeight,
|
||||
0,
|
||||
0,
|
||||
)
|
||||
|
||||
val goneMargin = (navigationBarHeight + resources.getDimension(R.dimen.big_margin)).toInt()
|
||||
(shutter.layoutParams as ConstraintLayout.LayoutParams).goneBottomMargin = goneMargin
|
||||
|
||||
(video_rec_curr_timer.layoutParams as ConstraintLayout.LayoutParams).setMargins(
|
||||
0,
|
||||
0,
|
||||
|
Reference in New Issue
Block a user