Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #11044 - Sets the anchorView of the snackbar to be the new tab fab
Browse files Browse the repository at this point in the history
  • Loading branch information
boek committed Jun 26, 2020
1 parent 7287b55 commit 2571a27
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
}
}
Expand Down Expand Up @@ -226,7 +228,8 @@ class TabTrayDialogFragment : AppCompatDialogFragment() {
context?.components?.core?.sessionManager?.restore(snapshot)
},
operation = { },
elevation = ELEVATION
elevation = ELEVATION,
anchorView = tabTrayView.fabView.new_tab_button
)
}
}
Expand All @@ -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()
Expand Down

0 comments on commit 2571a27

Please sign in to comment.