Loading mobile/android/android-components/components/feature/sitepermissions/src/main/java/mozilla/components/feature/sitepermissions/SitePermissionsDialogFragment.kt +9 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import androidx.core.graphics.drawable.toDrawable import mozilla.components.support.base.android.NoObscuredTouchesDialogFragment import mozilla.components.support.base.log.logger.Logger import mozilla.components.support.ktx.util.PromptAbuserDetector import mozilla.components.support.utils.OnEnterAnimationCompleteListener internal const val KEY_SESSION_ID = "KEY_SESSION_ID" internal const val KEY_TITLE = "KEY_TITLE" Loading @@ -42,7 +43,9 @@ private const val KEY_IS_NOTIFICATION_REQUEST = "KEY_IS_NOTIFICATION_REQUEST" private const val DEFAULT_VALUE = Int.MAX_VALUE private const val KEY_PERMISSION_ID = "KEY_PERMISSION_ID" internal open class SitePermissionsDialogFragment : NoObscuredTouchesDialogFragment() { internal open class SitePermissionsDialogFragment : NoObscuredTouchesDialogFragment(), OnEnterAnimationCompleteListener { private val logger = Logger("SitePermissionsDialogFragment") Loading Loading @@ -124,6 +127,11 @@ internal open class SitePermissionsDialogFragment : NoObscuredTouchesDialogFragm feature?.onDismiss(permissionRequestId, sessionId) } override fun onEnterAnimationComplete() { // Extend the positive button click delay. promptAbuserDetector.updateJSDialogAbusedState() } private fun Dialog.setContainerView(rootView: View) { if (dialogShouldWidthMatchParent) { setContentView(rootView) Loading mobile/android/android-components/components/support/utils/src/main/java/mozilla/components/support/utils/OnEnterAnimationCompleteListener.kt 0 → 100644 +16 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package mozilla.components.support.utils /** * Allows forwarding [android.app.Activity.onEnterAnimationComplete] to other classes * (e.g. fragments) that want to participate in handling it. */ interface OnEnterAnimationCompleteListener { /** * Called when the Activity's entering animation has completed. */ fun onEnterAnimationComplete() } mobile/android/fenix/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivity.kt +10 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ import androidx.annotation.VisibleForTesting import androidx.core.net.toUri import mozilla.components.browser.state.selector.findCustomTab import mozilla.components.browser.state.state.SessionState import mozilla.components.support.utils.OnEnterAnimationCompleteListener import mozilla.components.support.utils.SafeIntent import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.ext.components Loading Loading @@ -95,5 +96,14 @@ open class ExternalAppBrowserActivity : HomeActivity() { override fun onEnterAnimationComplete() { super.onEnterAnimationComplete() isFinishedAnimating = true val fragments = supportFragmentManager.fragments.toMutableList() while (fragments.isNotEmpty()) { val fragment = fragments.removeAt(0) if (fragment is OnEnterAnimationCompleteListener) { fragment.onEnterAnimationComplete() } fragments.addAll(fragment.childFragmentManager.fragments) } } } Loading
mobile/android/android-components/components/feature/sitepermissions/src/main/java/mozilla/components/feature/sitepermissions/SitePermissionsDialogFragment.kt +9 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import androidx.core.graphics.drawable.toDrawable import mozilla.components.support.base.android.NoObscuredTouchesDialogFragment import mozilla.components.support.base.log.logger.Logger import mozilla.components.support.ktx.util.PromptAbuserDetector import mozilla.components.support.utils.OnEnterAnimationCompleteListener internal const val KEY_SESSION_ID = "KEY_SESSION_ID" internal const val KEY_TITLE = "KEY_TITLE" Loading @@ -42,7 +43,9 @@ private const val KEY_IS_NOTIFICATION_REQUEST = "KEY_IS_NOTIFICATION_REQUEST" private const val DEFAULT_VALUE = Int.MAX_VALUE private const val KEY_PERMISSION_ID = "KEY_PERMISSION_ID" internal open class SitePermissionsDialogFragment : NoObscuredTouchesDialogFragment() { internal open class SitePermissionsDialogFragment : NoObscuredTouchesDialogFragment(), OnEnterAnimationCompleteListener { private val logger = Logger("SitePermissionsDialogFragment") Loading Loading @@ -124,6 +127,11 @@ internal open class SitePermissionsDialogFragment : NoObscuredTouchesDialogFragm feature?.onDismiss(permissionRequestId, sessionId) } override fun onEnterAnimationComplete() { // Extend the positive button click delay. promptAbuserDetector.updateJSDialogAbusedState() } private fun Dialog.setContainerView(rootView: View) { if (dialogShouldWidthMatchParent) { setContentView(rootView) Loading
mobile/android/android-components/components/support/utils/src/main/java/mozilla/components/support/utils/OnEnterAnimationCompleteListener.kt 0 → 100644 +16 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package mozilla.components.support.utils /** * Allows forwarding [android.app.Activity.onEnterAnimationComplete] to other classes * (e.g. fragments) that want to participate in handling it. */ interface OnEnterAnimationCompleteListener { /** * Called when the Activity's entering animation has completed. */ fun onEnterAnimationComplete() }
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivity.kt +10 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ import androidx.annotation.VisibleForTesting import androidx.core.net.toUri import mozilla.components.browser.state.selector.findCustomTab import mozilla.components.browser.state.state.SessionState import mozilla.components.support.utils.OnEnterAnimationCompleteListener import mozilla.components.support.utils.SafeIntent import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.ext.components Loading Loading @@ -95,5 +96,14 @@ open class ExternalAppBrowserActivity : HomeActivity() { override fun onEnterAnimationComplete() { super.onEnterAnimationComplete() isFinishedAnimating = true val fragments = supportFragmentManager.fragments.toMutableList() while (fragments.isNotEmpty()) { val fragment = fragments.removeAt(0) if (fragment is OnEnterAnimationCompleteListener) { fragment.onEnterAnimationComplete() } fragments.addAll(fragment.childFragmentManager.fragments) } } }