From 2571a27a94ce77b8a991533232d8703b1b8c9d92 Mon Sep 17 00:00:00 2001 From: Jeff Boek Date: Wed, 24 Jun 2020 17:15:26 -0700 Subject: [PATCH] For #11044 - Sets the anchorView of the snackbar to be the new tab fab --- .../org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt index 21f416e1eb78..cd877288fe08 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt @@ -15,6 +15,7 @@ import androidx.fragment.app.FragmentManager import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import kotlinx.android.synthetic.main.component_tabstray.view.* +import kotlinx.android.synthetic.main.component_tabstray_fab.view.* import kotlinx.android.synthetic.main.fragment_tab_tray_dialog.* import kotlinx.android.synthetic.main.fragment_tab_tray_dialog.view.* import mozilla.components.browser.session.Session @@ -182,7 +183,8 @@ class TabTrayDialogFragment : AppCompatDialogFragment() { sessionManager.add(snapshot.session, isSelected, engineSessionState = state) }, operation = { }, - elevation = ELEVATION + elevation = ELEVATION, + anchorView = tabTrayView.fabView.new_tab_button ) } } @@ -226,7 +228,8 @@ class TabTrayDialogFragment : AppCompatDialogFragment() { context?.components?.core?.sessionManager?.restore(snapshot) }, operation = { }, - elevation = ELEVATION + elevation = ELEVATION, + anchorView = tabTrayView.fabView.new_tab_button ) } } @@ -239,6 +242,7 @@ class TabTrayDialogFragment : AppCompatDialogFragment() { isDisplayedWithBrowserToolbar = true, view = (view as View) ) + .setAnchorView(tabTrayView.fabView.new_tab_button) .setText(requireContext().getString(R.string.create_collection_tabs_saved)) .setAction(requireContext().getString(R.string.create_collection_view)) { dismissAllowingStateLoss()