-
Notifications
You must be signed in to change notification settings - Fork 323
Bug 1812144 - Homescreen
appbar drag issue fixed
#852
Conversation
47285b1
to
3ba9f20
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.
Overall it looks okay but it is not a complete fix.
It is still possible to have more than two items in the RecyclerView
but with it's height still smaller than needed to overflow the screen height and so the issue will still be reproduceable even after this patch.
LostAppBar.mp4
Based on the above scenario it seems to me that we'd need to disable AppBarLayout
's dragging based on whether it's plus the height of the RecyclerView
is bigger than the available screen height.
*Maybe a bit more performant solution would be to set a flag only once on whether the homescreen should be draggable or not and use this in the setDragCallback
of the AppBarLayout
.
val behavior = AppBarLayoutBehaviorEmptyRecyclerView() | ||
appbarLayoutParams.behavior = behavior | ||
} | ||
binding.homeAppBar.setExpanded(true, true) |
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'm curious on why this is needed - line 513.
It will break the functionality from when the user navigates to a newly created collection.
fenix/app/src/main/java/org/mozilla/fenix/utils/AppBarLayoutBehaviorEmptyRecyclerView.kt
Outdated
Show resolved
Hide resolved
fenix/app/src/main/java/org/mozilla/fenix/utils/AppBarLayoutBehaviorEmptyRecyclerView.kt
Outdated
Show resolved
Hide resolved
fenix/app/src/main/java/org/mozilla/fenix/utils/AppBarLayoutBehaviorEmptyRecyclerView.kt
Outdated
Show resolved
Hide resolved
Thank you @Mugurell for reviewing the PR. 🙏 |
fb1b525
to
f72a8bf
Compare
🚧 Commit message is using the wrong format: Update SavedLoginsListView.kt The comment message should look like:
|
4 similar comments
🚧 Commit message is using the wrong format: Update SavedLoginsListView.kt The comment message should look like:
|
🚧 Commit message is using the wrong format: Update SavedLoginsListView.kt The comment message should look like:
|
🚧 Commit message is using the wrong format: Update SavedLoginsListView.kt The comment message should look like:
|
🚧 Commit message is using the wrong format: Update SavedLoginsListView.kt The comment message should look like:
|
Hello @Mugurell,🙏 |
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.
Thank you for the update!
Just one naming comment to ensure this change will be clear as intended for future readers.
appBarBehavior.setDragCallback( | ||
object : AppBarLayout.Behavior.DragCallback() { | ||
override fun canDrag(appBarLayout: AppBarLayout): Boolean { | ||
return false | ||
} | ||
}, | ||
) |
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.
Interesting approach to disable dragging in all scenarios.
Looking through the initial tickets for the current functionality - mozilla-mobile/fenix#99, mozilla-mobile/fenix#137, mozilla-mobile/fenix#7700 I don't see any discussions or indications about the scenarios in which we'd want the appBar to be draggable or not.
Given that currently the appBar can be dragged only when there aren't enough elements on the screen to overflow it and in this scenario the drag gesture results in the bug we need so solve disabling dragging seems like the sensible choice.
@@ -503,6 +505,21 @@ class HomeFragment : Fragment() { | |||
} | |||
} | |||
|
|||
private fun setScrollingBehavior() { |
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.
Sorry for the being pedantic but the new approach that will disable dragging in all situations I think warrants being specific about the intent.
Can you please rename to something like disableAppBarDragging()
.
It's an important behavior change that I think we need to highlight.
Thank you @Mugurell for reviewing the PR.🙏 |
bors try |
tryBuild failed: |
bors retry |
tryBuild failed: |
Same ui test failing in both try runs:
Seems like a new issue which needs to be investigated more before attempting to merge. |
Hello @Mugurell, |
Seems like the issue is real and is happening after these changes in this very specific scenario:
Expected result (as seen in the current applications):
Actual result (after this patch):
FenixHeaderBug.mp4We need to have the Firefox logo shown in all cases where the users goes to the homescreen - with the least amount of changes. |
Okay @Mugurell, Let me check it. |
) | ||
appBarLayoutParams.behavior = appBarBehavior | ||
} | ||
binding.homeAppBar.setExpanded(true) |
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 see this change being added in the last commit.
Is this proposed as a fix for the issue seen in tests - described more here - #852 (comment) ?
binding.homeAppBar.setExpanded(true)
would regress another behavior as described here - #852 (comment)
If the patch cannot be improved to avoid both issues we could check with UX to temporary approve one since the original issue seems a bit more important to fix.
Let me know what your thoughts are.
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.
Hello @Mugurell,
This fix is workaround with less code. If we need proper implementation, then for simple fix a lot more code would be added. As you mentioned on #852 (Comment) that make sure to add least changes.
@mozilla-mobile/ux Need your help on deciding how to go forward with this. We have 3 scenarios:
Giving that we plan to refactor the homescreen to Compose is it acceptable to merge this patch to fix the issue from https://bugzilla.mozilla.org/show_bug.cgi?id=1812144 and temporarily get one of the last two issues or should we avoid merging and leave the fix for the Bugzilla issue to be included in the Compose refactoring? |
@Verdi can you provide guidance on this one please? |
Ok @Mugurell and I went over the issues. The patch fixes the initial issue and makes the other two issues better by making the header visible. We should land this. |
Thank you all for the support and sticking through with this! @gitstart Can you please
|
🚧 Commit message is using the wrong format: updated-changes The comment message should look like:
|
Homescreen
title bar drag issue fixed
🚧 Commit message is using the wrong format: updated-changes The comment message should look like:
|
Homescreen
title bar drag issue fixedHomescreen
appbar drag issue fixed
🚧 Commit message is using the wrong format: updated-changes The comment message should look like:
|
Thank you @Mugurell, |
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.
LGTM. Thank you!
bors try |
Just a small remark that this will lead to another bug which will have the header expanded after navigating to a newly created collection - issue seen when there are more sections shown on the screen and the screen has to be scrolled to highlight the collection. This was discussed with @ Verdi and agreed that it's a smaller issue than the original one in which the private tabs button would not be seen and accepted until the Compose refactoring. ScrollingToACollection.mp4 |
tryBuild succeeded: |
Homescreen
Appbar is scrollable even if there is no content, fromcustomize homepage
all options disabled and then the appbar is scrolling if you tap on the bar and scroll up.Issue Screenshots
fnx-60-issue.webm
Fix Screenshots
fnx-60-fix.webm
Pull Request checklist
QA
GitHub Automation
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144
https://bugzilla.mozilla.org/show_bug.cgi?id=1812144