parent
9a582a6983
commit
cc8f34b68b
|
@ -19,12 +19,12 @@ class FenixSnackbarDelegate(val view: View) :
|
|||
listener: ((v: View) -> Unit)?
|
||||
) {
|
||||
if (listener != null && action != 0) {
|
||||
FenixSnackbar.makeWithToolbarPadding(view)
|
||||
FenixSnackbar.make(view, duration = FenixSnackbar.LENGTH_SHORT)
|
||||
.setText(view.context.getString(text))
|
||||
.setAction(view.context.getString(action)) { listener.invoke(view) }
|
||||
.show()
|
||||
} else {
|
||||
FenixSnackbar.makeWithToolbarPadding(view)
|
||||
FenixSnackbar.make(view, duration = FenixSnackbar.LENGTH_SHORT)
|
||||
.setText(view.context.getString(text))
|
||||
.show()
|
||||
}
|
||||
|
|
|
@ -110,18 +110,19 @@ class FenixSnackbar private constructor(
|
|||
}
|
||||
|
||||
/**
|
||||
* Considers BrowserToolbar for padding when making snackbar
|
||||
* Considers BrowserToolbar for padding when making snackbar. The vast majority of the time
|
||||
* you will want to pass in `fragment.view`.
|
||||
*/
|
||||
fun makeWithToolbarPadding(
|
||||
view: View,
|
||||
fragmentView: View,
|
||||
duration: Int = LENGTH_LONG,
|
||||
isError: Boolean = false
|
||||
): FenixSnackbar {
|
||||
val shouldUseBottomToolbar = view.context.settings().shouldUseBottomToolbar
|
||||
val toolbarHeight = view.context.resources
|
||||
val shouldUseBottomToolbar = fragmentView.context.settings().shouldUseBottomToolbar
|
||||
val toolbarHeight = fragmentView.context.resources
|
||||
.getDimensionPixelSize(R.dimen.browser_toolbar_height)
|
||||
|
||||
return make(view, duration, isError).apply {
|
||||
return make(fragmentView, duration, isError).apply {
|
||||
this.view.setPadding(
|
||||
0,
|
||||
0,
|
||||
|
|
|
@ -81,6 +81,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
|
|||
bookmarkStore = StoreProvider.get(this) {
|
||||
BookmarkFragmentStore(BookmarkFragmentState(null))
|
||||
}
|
||||
|
||||
bookmarkInteractor = BookmarkFragmentInteractor(
|
||||
bookmarkStore = bookmarkStore,
|
||||
viewModel = sharedViewModel,
|
||||
|
|
Loading…
Reference in New Issue