Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16147] Android: Support immediate transition for Ti.UI.ScrollableView.setCurrentPage

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterVladimir S
AssigneeUnknown
Created2014-01-01T18:01:26.000+0000
Updated2018-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)

Comments

  1. Pedro Enrique 2014-01-02

    Hi Vladimir, Have you tried using the currentPage API? If I understood correctly, this is what you're looking for
       var scrollable = Ti.UI.createScrollableView({
           views: [ view1, view2, view3, view4, etc..],
           currentPage: 2
       });
       // or
       scrollable.setCurrentPage(2);
       
    http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ScrollableView-method-setCurrentPage
  2. Vladimir S 2014-01-02

    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
  3. Vladimir S 2014-01-03

    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
  4. Ritu Agrawal 2014-01-08

    Moving this enhancement request to engineering for further evaluation and prioritization.
  5. Rene Pot 2016-10-11

    I guess this ticket can be closed as the functionality is here already?

JSON Source