[UI] Better support for Immersive mode on notched devices

This commit is contained in:
Prathamesh More 2021-12-01 13:49:52 +05:30
parent c6f6317839
commit 238c54c6fb
3 changed files with 6 additions and 2 deletions

View file

@ -136,6 +136,7 @@ fun ShapeableImageView.setCircleShape(boolean: Boolean) {
* This will draw our view above the navigation bar instead of behind it by adding margins.
*/
fun View.drawAboveSystemBars(onlyPortrait: Boolean = true) {
if (PreferenceUtil.isFullScreenMode) return
if (onlyPortrait && RetroUtil.isLandscape()) return
// Create a snapshot of the view's margin state
val initialMargin = recordInitialMarginForView(this)
@ -157,6 +158,7 @@ fun View.drawAboveSystemBars(onlyPortrait: Boolean = true) {
* This will draw our view above the navigation bar instead of behind it by adding padding.
*/
fun View.drawAboveSystemBarsWithPadding(consume: Boolean = false) {
if (PreferenceUtil.isFullScreenMode) return
val initialPadding = recordInitialPaddingForView(this)
ViewCompat.setOnApplyWindowInsetsListener(