File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed
Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable no-console */
22import {
33 EventData ,
4+ ItemEventData ,
5+ ListView ,
46 Observable ,
57 ObservableArray ,
68 Page ,
@@ -28,4 +30,23 @@ export function onStar(e: EventData) {
2830
2931export function onDelete ( e : EventData ) {
3032 console . log ( "DELETE" , ( e . object as ViewBase ) . bindingContext ) ;
33+ }
34+
35+ export function onItemTap ( e : ItemEventData ) {
36+ console . log ( e . index ) ;
37+ }
38+
39+
40+ export function nullifyTableViewSeparatorInsets ( args : ItemEventData ) {
41+ if ( global . isIOS ) {
42+ args . ios . separatorInset = UIEdgeInsetsZero ;
43+ args . ios . layoutMargins = UIEdgeInsetsZero ;
44+ args . ios . preservesSuperviewLayoutMargins = false ;
45+ }
46+ }
47+
48+ export function nullifyEmptyCells ( e : EventData ) {
49+ if ( global . isIOS ) {
50+ ( ( e . object as ListView ) . ios as UITableView ) . tableFooterView = UIView . alloc ( ) . initWithFrame ( CGRectZero ) ;
51+ }
3152}
Original file line number Diff line number Diff line change 11<Page xmlns =" http://schemas.nativescript.org/tns.xsd" xmlns : sv =" nativescript-swipe-view" navigatingTo =" navigatingTo" >
22 <ActionBar title =" Swipe View" icon =" " />
33
4- <ListView items =" {{ items }}" >
4+ <ListView
5+ items =" {{ items }}"
6+ loaded =" nullifyEmptyCells"
7+ itemLoading =" nullifyTableViewSeparatorInsets"
8+ itemTap =" onItemTap" >
59 <ListView .itemTemplate>
610 <sv : SwipeView >
711 <sv : SwipeView .leftActionsTemplate>
Original file line number Diff line number Diff line change 11{
22 "name" : " nativescript-swipe-view" ,
3- "version" : " 1.1 .0" ,
3+ "version" : " 1.2 .0" ,
44 "description" : " NativeScript plugin to connect with Azure Notification Hubs" ,
55 "main" : " dist/swipe-view" ,
66 "typings" : " swipe-view.d.ts" ,
Original file line number Diff line number Diff line change @@ -99,8 +99,10 @@ export class SwipeView extends GridLayout implements definition.SwipeView {
9999 this . _resetTransition ( ) ;
100100 }
101101 } ) ;
102+ this . parent ?. on ( "itemTap" , this . _resetTransition . bind ( this ) ) ;
103+
102104 this . on ( "pan" , this . _onPan . bind ( this ) ) ;
103- this . on ( "tap" , this . _resetTransition . bind ( this ) ) ;
105+ this . _swipeView . on ( "tap" , this . _resetTransition . bind ( this ) ) ;
104106 }
105107
106108 public onUnloaded ( ) : void {
You can’t perform that action at this time.
0 commit comments