Wrong calculation of suggestions list height #264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi again 🎉
I've fixed another issue that causes the suggestions list to be positioned not in the first item when suggestions are swapped.
The problem
The problem was that sometimes the suggestions RecyclerView create fewer items than the number of swapped suggestions, but it says that the items do not fill all the height suggestions. This is impossible because suggestions could not fill all the suggestions list view only if he can draw all swapped suggestions. So, when some suggestions are not drawn, is a signal that there are more suggestions than what suggestions list could fit, and this means that the suggestions list height fill all the view height.
Test
To test this, I've used an emulator with 4,5'' and 480x854 resolution. Also, I've tested this on an LG x220ds.
Then, I've changed the
DataHelper
color suggestions to this values. This caused the suggestionsRecyclerView
to draw fewer children than using shorter names.I've also forced to show 10 suggestions every time I type a work by changing the listener to this in
SlidingSearchResultsExampleFragment
:Before the fix
After the fix