Open hansemannn opened 2 years ago
About Android:
https://github.com/appcelerator/titanium_mobile/pull/9601
Animated vertical scrolling bugs mentioned above were solved by disabling the smooth scrolling animation. It now immediately jumps to the given position. This appears to be a Google bug in their Java NestedScrollView class.
That said: It works for me like this but it should be default false
of course and we might need to add that note to the README. Just in case:
public void scrollToBottom(boolean animated)
{
View view = this.scrollView;
if (view instanceof TiHorizontalScrollView) {
((TiHorizontalScrollView) view).fullScroll(View.FOCUS_RIGHT);
} else if (view instanceof TiVerticalScrollView) {
if (animated == false) {
((TiVerticalScrollView) view).fullScroll(View.FOCUS_DOWN);
} else {
NestedScrollView nestedScrollView = ((TiVerticalScrollView) view);
nestedScrollView.smoothScrollBy(0, nestedScrollView.getChildAt(0).getHeight());
}
}
}
@Kroll.method
public void scrollToBottom(@Kroll.argument(optional = true) HashMap args)
{
boolean animated = false;
if (args != null) {
animated = TiConvert.toBoolean(args.get("animated"), false);
}
handleScrollToBottom(animated);
}
public void handleScrollToBottom(boolean animated)
{
getScrollView().scrollToBottom(animated);
}
I have searched and made sure there are no existing issues for the issue I am filing
Description
There is currently no way to disable the animation when using
scrollToTop
andscrollToBottom
.Solution
It can be changed while keeping backwards compatibility 👍 Not sure if Android also allows this, so it could be added parity. To move fast, I would like to add iOS first and then add Android later if anyone needs it as well.
Alternatives
No response
Platforms
iOS