Conversation
| android:layout_marginEnd="20dp" | ||
| android:divider="@android:color/transparent" | ||
| android:smoothScrollbar="true" | ||
| android:overScrollMode="never" |
There was a problem hiding this comment.
I guess the question here is why. There is no explanation why we are doing that.
There was a problem hiding this comment.
overScrollMode is responsible for the "rubber band" effect in the lists. Here is a comparison on Pico (the Meta effect is slightly different).
- current:
rubberband_high_quality_noaudio.mp4
- this PR:
thispr_high_quality_noaudio.mp4
There was a problem hiding this comment.
yeah I know what the rubber band effect is, the question is why do we want to remove it, and secondly what's the relationship with adding search in the library?
There was a problem hiding this comment.
It introduces an unnatural effect when scrolling long lists that doesn't look good IMHO. On Oculus, it slows down the scroll at the edges, and compresses and expands the items.
com.oculus.vrshell-20241018-115624.trimmed.mp4
For this PR I spent a long time using these lists and looking at their implementation, so I noticed this issue.
This particular change is included as a separate commit.
41064d0 to
e47cece
Compare
Add a search bar for Bookmarks, History, and Downloads. Each view keeps a cached version of the list of items. When the user enters a search term, we filter this cached list and update the Adapter. This avoids having to query the backend each time. Currently this implementation updates the search results as the user types each character, but if this does not have good performance we can change it later on. There is a change to the OnScrollListener to ensure that the RecyclerView only requests the focus when it scrolls as a result of user interaction, which will close the on-screen keyboard.
Set the "overScrollMode" to "never" by default and remove those instances where it had been manually set. The overscroll mode is the responsible for the bouncing and rubber-band effect that happens when we reach the end of a scrollable list. This effect makes sense in a touchscreen but it looks jarring on VR.
Remove CustomLinearLayoutManager, a workaround for an old bug in the RecyclerView library and which is no longer necessary. This change was added back in 2019: MozillaReality/FirefoxReality#1879 A comment in the code explained the issue: > There seems to be a bug in the RecyclerView adapter that > makes it crash sometimes when updating the dataset. This > seems to be the only thing that works until there is > a new RecyclerView version > 1.0.0 that fixes it. We are already using version 1.3.2 of the RecyclerView library and the crash seems to be long gone.
e47cece to
5991daf
Compare
Add a search bar for Bookmarks, History, and Downloads.
Each of these views keeps a cached version of the list of items. When the user enters a search term, we filter this cached list and update the Adapter. This avoids having to query the backend each time.
Currently this implementation updates the search results as the user types each character, but if this does not have good performance we can change it later on.
There is a change to the OnScrollListener to ensure that the RecyclerView only requests the focus when it scrolls as a result of user interaction, which will close the on-screen keyboard.
This PR also contains a couple of related changes to our RecyclerView lists.
First, we set the
overScrollModetoneverby default and remove those instances where it had been manually set. This removes the bouncing rubber band effect when scrolling the list.Secondly, we remove
CustomLinearLayoutManager, a workaround for an old bug in the RecyclerView library which is no longer necessary.