GithubHelp home page GithubHelp logo

k0sukey / tiisrefreshcontrol Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 7.0 9.48 MB

Wrapping ISRefreshControl for Ti.UI.TableView and Ti.UI.ListView on Titanium Mobile.

License: Other

Objective-C 72.30% JavaScript 8.78% Python 18.91%

tiisrefreshcontrol's People

Contributors

k0sukey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tiisrefreshcontrol's Issues

small memory leaks ?

self.refreshControl = [(id)[[ISRefreshControl alloc] init] seems to create a memory leak

autorelease seems to be needed since ISRefreshControl *refreshControl is a retain property

-(void)initializeState
{
[super initializeState];

if (self)
{
    self.refreshControl = [(id)[[ISRefreshControl alloc] init] autorelease]; // autorelease needed ?
    [self.refreshControl addTarget:self
                       action:@selector(refreshStart)
             forControlEvents:UIControlEventValueChanged];
}

}

Doesn't work inside a SplitWindow

When I try to drag the list down to see the refreshcontrol it just releases the list immediately which makes it impossible to drag it down enough to refresh.

Test case:

function createWin() {
    var win = Ti.UI.createWindow();

    var list = Ti.UI.createListView({
        refreshControlEnabled: true
    });

    list.addEventListener('refreshstart', function () {
        setTimeout(function () {
            list.refreshFinish();
        }, 1000);
    });

    win.add(list);

    return win;
}

var win = Ti.UI.iPad.createSplitWindow({
    detailView: createWin(),
    masterView: Ti.UI.createWindow()
});

win.open();

Using d22dbde

Multiple ListView interferes with each other

It seems like having multiple ListViews with TiISRefreshControl loaded at once makes them interfere with each other. This makes the second loaded window with a ListView not getting events or having any of the methods working.

I'm using the NappDrawer module to have multiple windows open at once. The first one is visible if you swipe right. The refresh control works there and hides after 1s. While in the second main view it does not, and keeps spinning forever.

var NappDrawer = require('dk.napp.drawer');

function createWin() {
    var win = Ti.UI.createWindow();

    var list = Ti.UI.createListView({
        refreshControlEnabled: true
    });

    list.addEventListener('refreshstart', function () {
        console.log('list1 refreshstart');
        setTimeout(function () {
            console.log('list1 refreshstart:done');
            list.refreshFinish();
        }, 1000);
    });

    win.add(list);

    return win;
}

function createWin2() {
    var win = Ti.UI.createWindow();

    var list = Ti.UI.createListView({
        refreshControlEnabled: true
    });

    list.addEventListener('refreshstart', function () {
        console.log('list2 refreshstart');
        setTimeout(function () {
            console.log('list2 refreshstart:done');
            list.refreshFinish();
        }, 1000);
    });

    win.add(list);

    return win;
}

var win = NappDrawer.createDrawer({
    leftWindow: createWin(),
    centerWindow: createWin2(),
    closeDrawerGestureMode: NappDrawer.CLOSE_MODE_ALL,
    openDrawerGestureMode: NappDrawer.OPEN_MODE_ALL,
    leftDrawerWidth: 200
});

win.open();

Full runnable testcase here.

Using d22dbde

3.1.3.x refresh events

I built the module using 3.1.3.v20130906144623 and tried using it in my app (also uses the same SDK)

The refresh events are not fired. Works on 3.1.2.GA perfectly fine. Known issue?

What would be a possible fix?

I hear 3.1.3.GA releases today or tomorrow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.