Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits: f710da91 by clairehurst at 2024-04-17T22:07:23+00:00 fixup! Implement Android-native Connection Assist UI
- - - - -
2 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt - fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
Changes:
===================================== fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt ===================================== @@ -816,10 +816,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorIn
final override fun onBackPressed() { supportFragmentManager.primaryNavigationFragment?.childFragmentManager?.fragments?.forEach { - if (it is HomeFragment){ - finish() - return - } if (it is UserInteractionHandler && it.onBackPressed()) { return }
===================================== fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt ===================================== @@ -61,6 +61,7 @@ import mozilla.components.feature.top.sites.TopSitesProviderConfig import mozilla.components.lib.state.ext.consumeFlow import mozilla.components.lib.state.ext.consumeFrom import mozilla.components.service.glean.private.NoExtras +import mozilla.components.support.base.feature.UserInteractionHandler import mozilla.components.support.base.feature.ViewBoundFeatureWrapper import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged import org.mozilla.fenix.BuildConfig @@ -122,7 +123,7 @@ import java.lang.ref.WeakReference import kotlin.math.min
@Suppress("TooManyFunctions", "LargeClass") -class HomeFragment : Fragment() { +class HomeFragment : Fragment(), UserInteractionHandler { private val args by navArgs<HomeFragmentArgs>()
@VisibleForTesting @@ -1016,4 +1017,9 @@ class HomeFragment : Fragment() { // Elevation for undo toasts internal const val TOAST_ELEVATION = 80f } + + override fun onBackPressed(): Boolean { + requireActivity().finish() + return true + } }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/f710...
tor-commits@lists.torproject.org