[TIMOB-16147] Android: Support immediate transition for Ti.UI.ScrollableView.setCurrentPage
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Vladimir S |
Assignee | Unknown |
Created | 2014-01-01T18:01:26.000+0000 |
Updated | 2018-02-28T20:03:59.000+0000 |
Description
It would be nice if you could add an option to have immediate transition when invoking 'setCurrentPage' on Ti.UI.ScrollableView. It is useful if the views are dynamically preloaded, and helps to allow rotating the views w/o the user noticing it. e.g. scroll a large amount of data, and have only a couple of views initialized
On IOS it already works this way.
For Android, i tried to hardcode it in TiUIScrollableView.java, method move(int), line 383, to
mPager.setCurrentItem(index, false); //false = immediate transition
and it works as expected (but is not configurable)
Hi Vladimir, Have you tried using the currentPage API? If I understood correctly, this is what you're looking for
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ScrollableView-method-setCurrentPage
Hi Pedro, Yes - this is the API I am using. But on IOS it transitions immeidately to the specified page. While on Android it does a smooth transition. It would be good if this was configurable (Simillar like in the ScrollView - http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ScrollView-method-setContentOffset) Like I said - the underlying implementation of ViewPager supports it - it just needs to be called with the specified parameter. Regards, Vladimir
Hi Pedro, Now i saw that i have confused you by giving the wrong method name "setPosition" instead of "setCurrentPage". Sorry for that. I meant the latter. I fixed the description and short text of the issue to reflect this Regards, Vladimir
Moving this enhancement request to engineering for further evaluation and prioritization.
I guess this ticket can be closed as the functionality is here already?