Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Add a sticky footer RecyclerView #9932

Closed
Mugurell opened this issue Mar 18, 2021 · 3 comments · Fixed by #10058
Closed

Add a sticky footer RecyclerView #9932

Mugurell opened this issue Mar 18, 2021 · 3 comments · Fixed by #10058
Assignees
Milestone

Comments

@Mugurell
Copy link
Contributor

Mugurell commented Mar 18, 2021

Saw the need for this on Fenix - mozilla-mobile/fenix#17772 which intends to use a collapsed menu with not all items shown on the screen. The list of items may be so big that even if the menu fits the screen not all items would be shown.

navigationButtonsNotSticky.mp4

 
From that ticket I understand there is a need to always show the list of navigation buttons

so we need a RecyclerView with sticky footers support and a property added to each BrowserMenuItem to indicate that that item should be a sticky footer.

┆Issue is synchronized with this Jira Task

@Mugurell Mugurell changed the title Add a sticky header RecyclerView Add a sticky footer RecyclerView Mar 18, 2021
@Mugurell
Copy link
Contributor Author

Asking UX if we should use a sticky header/footer for all browser menus.
(for example when showing the menu while in landscape, do we want to keep that navigation buttons row fixed in place (at the top/bottom of the menu) and only scroll the rest of the items?)

@Mugurell
Copy link
Contributor Author

Asking @topotropic and also @channingcarter how important showing the navigation buttons bar is and if we want it displayed in all cases. (with rest of the menu items scrollable but this always fixed in place and visible).

@eliserichards
Copy link

Confirmed with @topotropic and @channingcarter that this should definitely be done now 👍

@Mugurell Mugurell linked a pull request Apr 9, 2021 that will close this issue
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 12, 2021
…eader / footer

Vertical LinearLayoutManager configured with StickyItemPlacement such that:
- if StickyItemPlacement.TOP the sticky item will not be scrolled upwards
off-screen
- if StickyItemPlacement.TOP the sticky item will not be scrolled downwards
off-screen
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 12, 2021
Most of the menu items should support this new property and allow AC clients to
configure the menus such that a specific menu item will not be scrolled
off-screen but rather anchored to the top/bottom of the menu following where
the menu is anchored.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 12, 2021
…pter

The most important new responsibilities are to update the view of the sticky
item.

BrowserMenu's background is only set on the parent's layout so the Adapter will
have to set that same background to the sticky item's view such that other
items scrolling underneath it will be totally obscured.

Because the menu's background can be set in multiple ways (by setting a value
for mozac_browser_menu_background / by passing a MenuStyle or like in Fenix
having a default theme for all "above" views) BrowserMenu will offer a new
backgroundColor property that as the single source of truth for this which can
then be used by the Adapter.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 12, 2021
If the menu starts as collapsed and it has a sticky footer set the bottom item
until which the menu should be collapsed must be shown on top of the sticky
item's view. For this the entire menu has to have as offset the height of the
sticky item's view.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…eader / footer

Vertical LinearLayoutManager configured with StickyItemPlacement such that:
- if StickyItemPlacement.TOP the sticky item will not be scrolled upwards
off-screen
- if StickyItemPlacement.TOP the sticky item will not be scrolled downwards
off-screen
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
Most of the menu items should support this new property and allow AC clients to
configure the menus such that a specific menu item will not be scrolled
off-screen but rather anchored to the top/bottom of the menu following where
the menu is anchored.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…pter

The most important new responsibilities are to update the view of the sticky
item.

BrowserMenu's background is only set on the parent's layout so the Adapter will
have to set that same background to the sticky item's view such that other
items scrolling underneath it will be totally obscured.

Because the menu's background can be set in multiple ways (by setting a value
for mozac_browser_menu_background / by passing a MenuStyle or like in Fenix
having a default theme for all "above" views) BrowserMenu will offer a new
backgroundColor property that as the single source of truth for this which can
then be used by the Adapter.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…ooter item index

If the menu starts as collapsed and it has a sticky footer set the bottom item
until which the menu should be collapsed must be shown on top of the sticky
item's view.
As an edgecase, if the same item is the limit of the collapsed menu and also
the sticky footer that will be the last item shown in the collapsed menu but
will be shown with full height.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…pter

The most important new responsibilities are to update the view of the sticky
item.

BrowserMenu's background is only set on the parent's layout so the Adapter will
have to set that same background to the sticky item's view such that other
items scrolling underneath it will be totally obscured.

Because the menu's background can be set in multiple ways (by setting a value
for mozac_browser_menu_background / by passing a MenuStyle or like in Fenix
having a default theme for all "above" views) BrowserMenu will offer a new
backgroundColor property that as the single source of truth for this which can
then be used by the Adapter.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…ooter item index

If the menu starts as collapsed and it has a sticky footer set the bottom item
until which the menu should be collapsed must be shown on top of the sticky
item's view.
As an edgecase, if the same item is the limit of the collapsed menu and also
the sticky footer that will be the last item shown in the collapsed menu but
will be shown with full height.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…eader / footer

Vertical LinearLayoutManager configured with StickyItemPlacement such that:
- if StickyItemPlacement.TOP the sticky item will not be scrolled upwards
off-screen
- if StickyItemPlacement.TOP the sticky item will not be scrolled downwards
off-screen
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
Most of the menu items should support this new property and allow AC clients to
configure the menus such that a specific menu item will not be scrolled
off-screen but rather anchored to the top/bottom of the menu following where
the menu is anchored.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…pter

The most important new responsibilities are to update the view of the sticky
item.

BrowserMenu's background is only set on the parent's layout so the Adapter will
have to set that same background to the sticky item's view such that other
items scrolling underneath it will be totally obscured.

Because the menu's background can be set in multiple ways (by setting a value
for mozac_browser_menu_background / by passing a MenuStyle or like in Fenix
having a default theme for all "above" views) BrowserMenu will offer a new
backgroundColor property that as the single source of truth for this which can
then be used by the Adapter.
Mugurell added a commit to Mugurell/android-components that referenced this issue Apr 14, 2021
…ooter item index

If the menu starts as collapsed and it has a sticky footer set the bottom item
until which the menu should be collapsed must be shown on top of the sticky
item's view.
As an edgecase, if the same item is the limit of the collapsed menu and also
the sticky footer that will be the last item shown in the collapsed menu but
will be shown with full height.
@mergify mergify bot closed this as completed in #10058 Apr 14, 2021
mergify bot pushed a commit that referenced this issue Apr 14, 2021
Vertical LinearLayoutManager configured with StickyItemPlacement such that:
- if StickyItemPlacement.TOP the sticky item will not be scrolled upwards
off-screen
- if StickyItemPlacement.TOP the sticky item will not be scrolled downwards
off-screen
mergify bot pushed a commit that referenced this issue Apr 14, 2021
Most of the menu items should support this new property and allow AC clients to
configure the menus such that a specific menu item will not be scrolled
off-screen but rather anchored to the top/bottom of the menu following where
the menu is anchored.
mergify bot pushed a commit that referenced this issue Apr 14, 2021
The most important new responsibilities are to update the view of the sticky
item.

BrowserMenu's background is only set on the parent's layout so the Adapter will
have to set that same background to the sticky item's view such that other
items scrolling underneath it will be totally obscured.

Because the menu's background can be set in multiple ways (by setting a value
for mozac_browser_menu_background / by passing a MenuStyle or like in Fenix
having a default theme for all "above" views) BrowserMenu will offer a new
backgroundColor property that as the single source of truth for this which can
then be used by the Adapter.
mergify bot pushed a commit that referenced this issue Apr 14, 2021
If the menu starts as collapsed and it has a sticky footer set the bottom item
until which the menu should be collapsed must be shown on top of the sticky
item's view.
As an edgecase, if the same item is the limit of the collapsed menu and also
the sticky footer that will be the last item shown in the collapsed menu but
will be shown with full height.
@gabrielluong gabrielluong added this to the 75.0.0 milestone Apr 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants