mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
This commit is contained in:
parent
f89b157c23
commit
a18c1befd1
@ -10,11 +10,13 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.updatePadding
|
||||
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
|
||||
@ -43,6 +45,10 @@ class TabTrayDialogFragment : AppCompatDialogFragment() {
|
||||
private val tabTrayView: TabTrayView
|
||||
get() = _tabTrayView!!
|
||||
|
||||
private val snackbarAnchor: View?
|
||||
get() = if (tabTrayView.fabView.new_tab_button.isVisible) tabTrayView.fabView.new_tab_button
|
||||
else null
|
||||
|
||||
private val collectionStorageObserver = object : TabCollectionStorage.Observer {
|
||||
override fun onCollectionCreated(title: String, sessions: List<Session>) {
|
||||
showCollectionSnackbar()
|
||||
@ -188,7 +194,8 @@ class TabTrayDialogFragment : AppCompatDialogFragment() {
|
||||
sessionManager.add(snapshot.session, isSelected, engineSessionState = state)
|
||||
},
|
||||
operation = { },
|
||||
elevation = ELEVATION
|
||||
elevation = ELEVATION,
|
||||
anchorView = snackbarAnchor
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -232,7 +239,8 @@ class TabTrayDialogFragment : AppCompatDialogFragment() {
|
||||
context?.components?.core?.sessionManager?.restore(snapshot)
|
||||
},
|
||||
operation = { },
|
||||
elevation = ELEVATION
|
||||
elevation = ELEVATION,
|
||||
anchorView = snackbarAnchor
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -245,6 +253,7 @@ class TabTrayDialogFragment : AppCompatDialogFragment() {
|
||||
isDisplayedWithBrowserToolbar = true,
|
||||
view = (view as View)
|
||||
)
|
||||
.setAnchorView(snackbarAnchor)
|
||||
.setText(requireContext().getString(R.string.create_collection_tabs_saved))
|
||||
.setAction(requireContext().getString(R.string.create_collection_view)) {
|
||||
dismissAllowingStateLoss()
|
||||
|
Loading…
Reference in New Issue
Block a user