iskugor / Ti.SwipeRefreshLayout

Titanium module for Android's SwipeRefreshLayout.
56 stars 19 forks source link

Issue when adding swipe Event to Window #16

Open X-Tender opened 9 years ago

X-Tender commented 9 years ago

When I add a swipe Event to the Window which contains the Widget (for example to catch the left / right swipe) then The reloadprocess doesn't get called. The Refresh Icon just stay there when I pulled it down (The Circle with the rotating Arrow in it)

Android 5.1

iskugor commented 9 years ago

Could you send some code that reproduces issue you're seeing? Thanks

X-Tender commented 9 years ago

Sorry, cant send the entire code,

Basicly it's just this.

When I add this to my controller the refresh did not work.

$.mainWindow.addEventListener( 'swipe', function( e ) {
    Ti.API.info(e);
    Ti.API.info(e.direction);
    if( e.direction == 'right' ) {
        openMenu();
    }else if( e.direction == 'left' ){
        closeMenu();
    }
});

function onPulldown( e ) {
 // refresh function call
    e.hide();
}

That's my Layout

<Alloy>
    <Window id="mainWindow">
        <!-- DRAWER MENU -->
        <View id="drawerMenu" layout="vertical">
            <Button id="closeMenuButton" onClick="closeMenu" title="X" />
            <ImageView id="submenuIcon" image="/images/logoSmall.png" />
            <Label id="submenuHeadline" >Settings</Label>
            <TableView>
                <TableViewRow class="subMenuItemTableRow" onClick="openAssignment" layout="vertical">
                    <View class="settingsRowContentHolder" layout="horizontal">
                        <View class="subMenuItemIconCol">
                            <!-- ADD SETTINGS ICON HERE -->
                        </View>
                        <View class="subMenuItemTextCol" layout="horizontal">
                            <Label class="submenuDescription">Assignment</Label>
                        </View>
                    </View>
                    <View class="settingsDivider" />
                </TableViewRow>
                <TableViewRow class="subMenuItemTableRow" onClick="openAdvanced" layout="vertical">
                    <View class="settingsRowContentHolder" layout="horizontal">
                        <View class="subMenuItemIconCol">
                            <!-- ADD SETTINGS ICON HERE -->
                        </View>
                        <View class="subMenuItemTextCol" layout="horizontal">
                            <Label class="submenuDescription">Advanced</Label>
                        </View>
                    </View>
                    <View class="settingsDivider" />
                </TableViewRow>
            </TableView>
        </View>

        <!-- COVERLAYER -->
        <View id="coverLayer" layout="vertical" />

        <!-- STOCK CONTENT -->
        <View id="stockContent" layout="vertical">
            <View id="actionBar" layout="horizontal">
                <Button id="menuButton" onClick="openMenu" title="Menu" />
                <Label id="actionbarHeadline">CarLogistics</Label>
                <!-- ADD LOGO ICON HERE -->
            </View>
            <View id="carBlueprintView">
                <ImageView image="/images/carBlueprint.png" />
            </View>
            <View id="stockHeadlineView" layout="horizontal" >
                <Label id="stockHeadline">Stock</Label>
            </View>
            <View id="tableView" layout="vertical">
                <Widget src="nl.fokkezb.pullToRefresh" onRelease="onPulldown">
                    <TableView id="stockTable" onClick="selectItem" />
                </Widget>
            </View>
        </View>
    </Window>
</Alloy>

I use the 3.5.1.GA SDK in Titanium

X-Tender commented 9 years ago

Have an idea why this happen? Also it runs on Android 5.1.

iskugor commented 9 years ago

Sorry, but no.