File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed
Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 1111 </sv : SwipeView .leftActionsTemplate>
1212
1313 <sv : SwipeView .rightActionsTemplate>
14- <StackLayout backgroundColor =" red" color =" white" tap =" onDelete" >
15- <Label text =" Delete" />
16- </StackLayout >
14+ <GridLayout rows = " *, auto, * " backgroundColor =" red" color =" white" tap =" onDelete" >
15+ <Label row = " 1 " text =" Delete" />
16+ </GridLayout >
1717 </sv : SwipeView .rightActionsTemplate>
1818
19- <GridLayout backgroundColor =" white" >
19+ <StackLayout backgroundColor =" white" >
20+ <Label text =" {{ value }}" verticalAlignment =" center" />
21+ <Label text =" {{ value }}" verticalAlignment =" center" />
2022 <Label text =" {{ value }}" verticalAlignment =" center" />
21- </GridLayout >
23+ </StackLayout >
2224 </sv : SwipeView >
2325 </ListView .itemTemplate>
2426 </ListView >
Original file line number Diff line number Diff line change 11{
22 "name" : " nativescript-swipe-view" ,
3- "version" : " 1.0 .0" ,
3+ "version" : " 1.1 .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 @@ -128,11 +128,24 @@ export class SwipeView extends GridLayout implements definition.SwipeView {
128128 return ;
129129 }
130130
131- if ( this . _prevPanState !== e . state ) {
131+ // Swipe start
132+ if ( e . state === 2
133+ && this . _prevPanState !== e . state ) {
132134 this . parent ?. notify ( {
133135 eventName : SwipeView . swipeViewSwipeStartedEvent ,
134136 object : this ,
135137 } ) ;
138+
139+ // Set the height of the swipe view to the max from all. Otherwise it is not resized correctly.
140+ const itemViewHeight = this . getChildAt ( 1 ) ?. getMeasuredHeight ( ) ;
141+ const leftActionsHeight = this . _leftActionsTemplateView ?. getMeasuredHeight ( ) ;
142+ const rightActionsHeight = this . _rightActionsTemplateView ?. getMeasuredHeight ( ) ;
143+ const finalHeight = Math . max (
144+ itemViewHeight || 0 ,
145+ leftActionsHeight || 0 ,
146+ rightActionsHeight || 0 ,
147+ ) ;
148+ this . _swipeView . height = Utils . layout . toDeviceIndependentPixels ( finalHeight ) ;
136149 }
137150
138151 this . _prevPanState = e . state ;
You can’t perform that action at this time.
0 commit comments