-
Notifications
You must be signed in to change notification settings - Fork 333
Bug 1879370 - Add a ClippingBehavior supporting multiple toolbars #5988
Bug 1879370 - Add a ClippingBehavior supporting multiple toolbars #5988
Conversation
5494464
to
f0510fd
Compare
074974b
to
6f7540c
Compare
* The bottom toolbar can consist of a navigation bar, | ||
* a combination of a navigation and address bar, or be absent. | ||
*/ | ||
fun Context.getBottomToolbarHeight(): Int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Think we can move this and getTopToolbarHeight
to Settings.kt
Also, thoughts on naming this tobottomBarsHeight
since there can be two bars at the bottom and not just toolbar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we could find a better place for the extension, but is Settings.kt
a good fit? It doesn't have any extension functions.
It might be slightly confusing and lead readers to believe that there should be a different name for getting a single bottomBarHeight
🤔 In context of toolbar translations, I believe it's better to think about toolbars as a top/bottom pair. From the Behaviour
perspective, there are two ScrollableToolbar
one at the top, one at the bottom, and sometimes they are there together. It doesn't really care about the contents, only about positioning.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Settings
is injected with appContext
so we have prefs and can access resources too. In the long run, each feature should have it's own prefs but since we use Settings.kt as the only pref service, think it makes sense to put it there.
That's a good point and perspective to look at the toolbars and is in sync with the rest of the implementation. Top/bottom pair 👍
fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
Outdated
Show resolved
Hide resolved
fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
Show resolved
Hide resolved
.../app/src/main/java/org/mozilla/fenix/components/toolbar/navbar/EngineViewClippingBehavior.kt
Outdated
Show resolved
Hide resolved
0d11c18
to
c02ebf6
Compare
fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/EngineViewClippingBehaviorTest.kt
Outdated
Show resolved
Hide resolved
fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/EngineViewClippingBehaviorTest.kt
Show resolved
Hide resolved
c02ebf6
to
73d5f32
Compare
fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/EngineViewClippingBehaviorTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is really good! 💯 Thanks for updating the docs!
A couple of comments about prefs and test contants!
is BrowserToolbar -> { | ||
if (hasTopToolbar) { | ||
recentTopToolbarTranslation = dependency.translationY | ||
} else { | ||
recentBottomToolbarTranslation = dependency.translationY | ||
} | ||
} | ||
is ToolbarContainerView -> recentBottomToolbarTranslation = dependency.translationY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking out loud, here we could try to use the interface ScrollableToolbar
to get this information so we don't have to depend on these implementations and we can also move this to AC module in that case.
Seems like we only need to know the positioning of the ScrollableToolbar
to act, so maybe a position()
function in the interface that returns an enum could help here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an awesome idea! The future work should be exploring this idea in more detail✌️
This pull request has conflicts when rebasing. Could you fix it @mavduevskiy? 🙏 |
dc3efa7
to
d0841b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Confirmed working as advertised. 🚢
d0841b2
to
8978295
Compare
Pull Request checklist
After merge
To download an APK when reviewing a PR (after all CI tasks finished running):
Checks
at the top of the PR page.firefoxci-taskcluster
group on the left to expand all tasks.build-apk-{fenix,focus,klar}-debug
task you're interested in.View task in Taskcluster
in the newDETAILS
section.GitHub Automation
https://bugzilla.mozilla.org/show_bug.cgi?id=1879370