-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Split Omnibar: Omnibar layout refactoring #6983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1963cc4 to
aa9f4d2
Compare
aa9f4d2 to
6b0dfce
Compare
6b0dfce to
0f2ea5d
Compare
LukasPaczos
left a comment
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.
The changes generally look good and work as expected. However, the new UnifiedOmnibarLayout.kt file is difficult to review in its current form. If this is intended to be the long-term layout location, it also loses the git history from all iterations of OmnibarLayout.
Instead of creating a new UnifiedOmnibarLayout.kt file, I suggest:
- Copy the existing
OmnibarLayoutinto a new file (LegacyOmnibarLayout?). - Rename the existing
OmnibarLayouttoUnifiedOmnibarLayout. - Apply the necessary changes there.
- When we're confident in the changes, we'll remove the
Legacy*copies.
The same approach can be used for the XML files, view model, and view model tests. This should be straightforward to copy-paste and would preserve git history and make the diff easier to review for the code that will remain long-term.
app/src/main/java/com/duckduckgo/app/browser/omnibar/OmnibarLayout.kt
Outdated
Show resolved
Hide resolved
|
Thanks @LukasPaczos! I've refactored the code as you suggested. In fact, while working on this I realized that a separate ViewModel is not needed as there is no new functionality and a single |
This reverts commit 571c354.
d7dd418 to
69f6484
Compare
LukasPaczos
left a comment
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 great!
Task/Issue URL: https://app.asana.com/1/137249556945/project/414730916066338/task/1211782850017596?focus=true ### Description Resolve a regression where function invocation changed from an extension to recursion during a refactor in #6983. ### Steps to test this PR - [x] Open the app. - [x] Search and go to videos. - [x] Start a video. - [x] Open full screen. - [x] Close full screen.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1207418217763355/task/1211565479656354
Description
This PR refactors the
OmnibarLayoutandSingleOmnibarLayout.OmnibarLayoutwas renamed toLegacyOmnibarLayoutand a newOmnibarLayoutis a unified, merged version ofOmnibarLayoutandSingleOmnibarLayout.Thew new omnibar is guarded by a
useUnifiedOmnibarLayoutfeature flag. To make that work, anOminbarViewinterface needed to be extracted, which is now used within theOmnibarclass. Depending on the flag value, either the oldLegacyOmnibarLayoutor the newOmnibarLayoutis used. The feature flag is enabled by default.Also, some of the interfaces from
OmnibarLayouthad to be extracted (StateChange,Decoration) to avoid duplication.Steps to test this PR
FF enabled
FF disabled
useUnifiedOmnibarLayoutFF in the internal settings