Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7312] CLONE - Android: Scrollable View currentPage Doesn't Change When Scrolling 50%, Despite Comments in Code

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-19T11:42:14.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0
Fix Version/sRelease 3.0.2
ComponentsAndroid
Labelsmodule_scrollableview, qe-and011912, qe-testadded
ReporterDustin Hyde
AssigneeShameer Jan
Created2012-01-20T10:21:05.000+0000
Updated2017-03-17T18:45:10.000+0000

Description

Problem

The currentPage of a scrollable view does not always sync up with the visible dot. This happens because the dot is updated when the user scrolls over 50%, and the currentPage only updates when the underlying scroll view ends decelerating. This is a problem because the app may act based on the currentPage of the scrollable view. So if the user swipes, and then hits a button that shows different content based on the currentPage, the wrong content can show up.

Reproduction

Drop the following in an app.js, and swipe right and left to the various pages of the scrollable view. Down at the bottom, I have placed a label that is updated with the currentPage.
var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

var scroll = Ti.UI.createScrollableView({
    bottom: 30,
    views: [
        Ti.UI.createView({ backgroundColor: 'cyan' }),
        Ti.UI.createView({ backgroundColor: 'magenta' }),
        Ti.UI.createView({ backgroundColor: 'yellow' })
    ],
    pagingControlColor: '#000',
    pagingControlHeight: 30
});
win.add(scroll);

var currentPageLabel = Ti.UI.createLabel({
    text: 'Current Page: Loading...', textAlign: 'center',
    bottom: 0, right: 0, left: 0,
    height: 30,
    color: '#fff', backgroundColor: '#000'
});
win.add(currentPageLabel);
setInterval(function() {
    currentPageLabel.text = 'Current Page: ' + scroll.currentPage;
}, 50);

win.open();

Attachments

FileDateSize
new-17-52-34.png2013-03-19T12:26:34.000+000016143
Screenshot_2013-03-19-16-59-11.png2013-03-19T11:53:22.000+000017553

Comments

  1. Shameer Jan 2013-03-19

    The problem cannot reproduce with the release 3.0.2 and 3.1.0 see the screenshots
  2. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source