Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
cc8f34b6
Unverified
Commit
cc8f34b6
authored
Mar 12, 2020
by
Sawyer Blatz
Committed by
GitHub
Mar 12, 2020
Browse files
For #8773: Fixes issue with snackbar placement on ContextMenu (#8942)
parent
9a582a69
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/browser/FenixSnackbarDelegate.kt
View file @
cc8f34b6
...
...
@@ -19,12 +19,12 @@ class FenixSnackbarDelegate(val view: View) :
listener
:
((
v
:
View
)
->
Unit
)?
)
{
if
(
listener
!=
null
&&
action
!=
0
)
{
FenixSnackbar
.
make
WithToolbarPadding
(
view
)
FenixSnackbar
.
make
(
view
,
duration
=
FenixSnackbar
.
LENGTH_SHORT
)
.
setText
(
view
.
context
.
getString
(
text
))
.
setAction
(
view
.
context
.
getString
(
action
))
{
listener
.
invoke
(
view
)
}
.
show
()
}
else
{
FenixSnackbar
.
make
WithToolbarPadding
(
view
)
FenixSnackbar
.
make
(
view
,
duration
=
FenixSnackbar
.
LENGTH_SHORT
)
.
setText
(
view
.
context
.
getString
(
text
))
.
show
()
}
...
...
app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt
View file @
cc8f34b6
...
...
@@ -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
(
v
iew
:
View
,
fragmentV
iew
:
View
,
duration
:
Int
=
LENGTH_LONG
,
isError
:
Boolean
=
false
):
FenixSnackbar
{
val
shouldUseBottomToolbar
=
v
iew
.
context
.
settings
().
shouldUseBottomToolbar
val
toolbarHeight
=
v
iew
.
context
.
resources
val
shouldUseBottomToolbar
=
fragmentV
iew
.
context
.
settings
().
shouldUseBottomToolbar
val
toolbarHeight
=
fragmentV
iew
.
context
.
resources
.
getDimensionPixelSize
(
R
.
dimen
.
browser_toolbar_height
)
return
make
(
v
iew
,
duration
,
isError
).
apply
{
return
make
(
fragmentV
iew
,
duration
,
isError
).
apply
{
this
.
view
.
setPadding
(
0
,
0
,
...
...
app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt
View file @
cc8f34b6
...
...
@@ -81,6 +81,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
bookmarkStore
=
StoreProvider
.
get
(
this
)
{
BookmarkFragmentStore
(
BookmarkFragmentState
(
null
))
}
bookmarkInteractor
=
BookmarkFragmentInteractor
(
bookmarkStore
=
bookmarkStore
,
viewModel
=
sharedViewModel
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment