2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-05 21:20:45 +00:00

For #10504 - Show tab dialog on browserfragment

This commit is contained in:
Jeff Boek 2020-05-20 21:24:05 -07:00
parent 90cef752b0
commit cc6a380d45
3 changed files with 11 additions and 6 deletions

View File

@ -93,6 +93,7 @@ import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.sessionsOfType
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.home.SharedViewModel
import org.mozilla.fenix.tabtray.TabTrayDialogFragment
import org.mozilla.fenix.theme.ThemeManager
import org.mozilla.fenix.wifi.SitePermissionsWifiIntegration
import java.lang.ref.WeakReference
@ -208,7 +209,11 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
scope = viewLifecycleOwner.lifecycleScope,
tabCollectionStorage = requireComponents.core.tabCollectionStorage,
topSiteStorage = requireComponents.core.topSiteStorage,
sharedViewModel = sharedViewModel
sharedViewModel = sharedViewModel,
onTabCounterClicked = {
val tabTrayDialog = TabTrayDialogFragment()
tabTrayDialog.show(parentFragmentManager, null)
}
)
_browserInteractor = BrowserInteractor(

View File

@ -74,7 +74,8 @@ class DefaultBrowserToolbarController(
private val scope: CoroutineScope,
private val tabCollectionStorage: TabCollectionStorage,
private val topSiteStorage: TopSiteStorage,
private val sharedViewModel: SharedViewModel
private val sharedViewModel: SharedViewModel,
private val onTabCounterClicked: () -> Unit
) : BrowserToolbarController {
private val currentSession
@ -324,8 +325,9 @@ class DefaultBrowserToolbarController(
private fun animateTabAndNavigateHome() {
if (activity.settings().useNewTabTray) {
val directions = BrowserFragmentDirections.actionBrowserFragmentToTabsTrayFragment()
navController.navigate(directions)
// val directions = BrowserFragmentDirections.actionBrowserFragmentToTabsTrayFragment()
// navController.navigate(directions)
onTabCounterClicked.invoke()
return
}

View File

@ -4,7 +4,6 @@
package org.mozilla.fenix.tabtray
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -52,7 +51,6 @@ class TabTrayView(
behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
override fun onSlide(bottomSheet: View, slideOffset: Float) {
if (slideOffset > -0.4) {
fabView.new_tab_button.show()
} else {