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
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:
| ... | ... | @@ -816,10 +816,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorIn | 
| 816 | 816 | |
| 817 | 817 |      final override fun onBackPressed() {
 | 
| 818 | 818 |          supportFragmentManager.primaryNavigationFragment?.childFragmentManager?.fragments?.forEach {
 | 
| 819 | -            if (it is HomeFragment){
 | |
| 820 | -                finish()
 | |
| 821 | -                return
 | |
| 822 | -            }
 | |
| 823 | 819 |              if (it is UserInteractionHandler && it.onBackPressed()) {
 | 
| 824 | 820 |                  return
 | 
| 825 | 821 |              }
 | 
| ... | ... | @@ -61,6 +61,7 @@ import mozilla.components.feature.top.sites.TopSitesProviderConfig | 
| 61 | 61 |  import mozilla.components.lib.state.ext.consumeFlow
 | 
| 62 | 62 |  import mozilla.components.lib.state.ext.consumeFrom
 | 
| 63 | 63 |  import mozilla.components.service.glean.private.NoExtras
 | 
| 64 | +import mozilla.components.support.base.feature.UserInteractionHandler
 | |
| 64 | 65 |  import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
 | 
| 65 | 66 |  import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
 | 
| 66 | 67 |  import org.mozilla.fenix.BuildConfig
 | 
| ... | ... | @@ -122,7 +123,7 @@ import java.lang.ref.WeakReference | 
| 122 | 123 |  import kotlin.math.min
 | 
| 123 | 124 | |
| 124 | 125 |  @Suppress("TooManyFunctions", "LargeClass")
 | 
| 125 | -class HomeFragment : Fragment() {
 | |
| 126 | +class HomeFragment : Fragment(), UserInteractionHandler {
 | |
| 126 | 127 |      private val args by navArgs<HomeFragmentArgs>()
 | 
| 127 | 128 | |
| 128 | 129 |      @VisibleForTesting
 | 
| ... | ... | @@ -1016,4 +1017,9 @@ class HomeFragment : Fragment() { | 
| 1016 | 1017 |          // Elevation for undo toasts
 | 
| 1017 | 1018 |          internal const val TOAST_ELEVATION = 80f
 | 
| 1018 | 1019 |      }
 | 
| 1020 | + | |
| 1021 | +    override fun onBackPressed(): Boolean {
 | |
| 1022 | +        requireActivity().finish()
 | |
| 1023 | +        return true
 | |
| 1024 | +    }
 | |
| 1019 | 1025 |  } |