I was looking at Netflix app and their scrolling behaviour.I would like to do the same but don't know where to start. I know how to override LayoutManager
for RecyclerView
(though I don't to save that as last resort). Is there easier way to control scrolling speed using RowPresenter ?
Limit scrolling speed on ListRow
Asked Answered
Hi. Did you find a solution? –
Obbard
@Obbard I think I did I was messing with leanback back then. –
Apparent
Okay. Please let me know if you figured out how. I'm stuck and there is no help. –
Obbard
.. what does the scrolling in Netflix look like? –
Monas
did you find an answer? –
Crimple
Leanback supports setting scrolling speed for BaseGridView
from version 1.1.0-alpha03. You can set scrolling speed by using a method named setSmoothScrollSpeedFactor
in all sub-classes of BaseGridView
.
Implement the logic on your activity class, ovverride keys (OnKeyDown) on a way that will ignore the key event for 3-4 millis or sth.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
long current = System.currentTimeMillis();
boolean res = false;
if (current - mLastKeyDownTime < 300) {
res = true;
} else {
res = super.onKeyDown(keyCode, event);
mLastKeyDownTime = current;
}
return res;
}
© 2022 - 2024 — McMap. All rights reserved.