From fbe73cfc1d633a1b76f744889997295f56277e0d Mon Sep 17 00:00:00 2001 From: Jonathan Almeida Date: Tue, 9 Mar 2021 18:55:58 +0400 Subject: [PATCH] For #17804: Use enterToImmersiveMode from support-ktx component --- .../java/org/mozilla/fenix/browser/BaseBrowserFragment.kt | 2 +- app/src/main/java/org/mozilla/fenix/ext/Activity.kt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index 5a925e49d9..3ca1fa820f 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -110,7 +110,6 @@ import org.mozilla.fenix.downloads.DynamicDownloadDialog import org.mozilla.fenix.ext.accessibilityManager import org.mozilla.fenix.ext.breadcrumb import org.mozilla.fenix.ext.components -import org.mozilla.fenix.ext.enterToImmersiveMode import org.mozilla.fenix.ext.getPreferenceKey import org.mozilla.fenix.ext.hideToolbar import org.mozilla.fenix.ext.metrics @@ -129,6 +128,7 @@ import java.lang.ref.WeakReference import mozilla.components.feature.session.behavior.EngineViewBrowserToolbarBehavior import mozilla.components.feature.webauthn.WebAuthnFeature import mozilla.components.support.base.feature.ActivityResultHandler +import mozilla.components.support.ktx.android.view.enterToImmersiveMode import mozilla.components.feature.session.behavior.ToolbarPosition as MozacToolbarPosition /** diff --git a/app/src/main/java/org/mozilla/fenix/ext/Activity.kt b/app/src/main/java/org/mozilla/fenix/ext/Activity.kt index cfaa241692..e70b3fa51f 100644 --- a/app/src/main/java/org/mozilla/fenix/ext/Activity.kt +++ b/app/src/main/java/org/mozilla/fenix/ext/Activity.kt @@ -15,6 +15,13 @@ import mozilla.components.concept.base.crash.Breadcrumb * We don't use the equivalent function from Android Components because the stable flag messes * with the toolbar. See #1998 and #3272. */ +@Deprecated( + message = "Use the Android Component implementation instead.", + replaceWith = ReplaceWith( + "enterToImmersiveMode()", + "mozilla.components.support.ktx.android.view.enterToImmersiveMode" + ) +) fun Activity.enterToImmersiveMode() { window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) // This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17804