pull/600/head
Roger Yang 5 years ago committed by Emily Kager
parent 07b1f84ec6
commit cc81201934

@ -6,6 +6,7 @@ package org.mozilla.fenix.browser
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
@ -436,6 +437,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
sessionManager, sessionManager,
SessionUseCases(sessionManager), SessionUseCases(sessionManager),
customTabSessionId, customTabSessionId,
::viewportFitChange,
::fullScreenChanged ::fullScreenChanged
), ),
owner = this, owner = this,
@ -817,6 +819,14 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
pipFeature?.onPictureInPictureModeChanged(enabled) pipFeature?.onPictureInPictureModeChanged(enabled)
} }
private fun viewportFitChange(layoutInDisplayCutoutMode: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
val layoutParams = activity?.window?.attributes
layoutParams?.layoutInDisplayCutoutMode = layoutInDisplayCutoutMode
activity?.window?.attributes = layoutParams
}
}
private fun fullScreenChanged(inFullScreen: Boolean) { private fun fullScreenChanged(inFullScreen: Boolean) {
if (inFullScreen) { if (inFullScreen) {
FenixSnackbar.make( FenixSnackbar.make(

Loading…
Cancel
Save