File tree 3 files changed +22
-7
lines changed
3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 11
11
</sv : SwipeView .leftActionsTemplate>
12
12
13
13
<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 >
17
17
</sv : SwipeView .rightActionsTemplate>
18
18
19
- <GridLayout backgroundColor =" white" >
19
+ <StackLayout backgroundColor =" white" >
20
+ <Label text =" {{ value }}" verticalAlignment =" center" />
21
+ <Label text =" {{ value }}" verticalAlignment =" center" />
20
22
<Label text =" {{ value }}" verticalAlignment =" center" />
21
- </GridLayout >
23
+ </StackLayout >
22
24
</sv : SwipeView >
23
25
</ListView .itemTemplate>
24
26
</ListView >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nativescript-swipe-view" ,
3
- "version" : " 1.0 .0" ,
3
+ "version" : " 1.1 .0" ,
4
4
"description" : " NativeScript plugin to connect with Azure Notification Hubs" ,
5
5
"main" : " dist/swipe-view" ,
6
6
"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 {
128
128
return ;
129
129
}
130
130
131
- if ( this . _prevPanState !== e . state ) {
131
+ // Swipe start
132
+ if ( e . state === 2
133
+ && this . _prevPanState !== e . state ) {
132
134
this . parent ?. notify ( {
133
135
eventName : SwipeView . swipeViewSwipeStartedEvent ,
134
136
object : this ,
135
137
} ) ;
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 ) ;
136
149
}
137
150
138
151
this . _prevPanState = e . state ;
You can’t perform that action at this time.
0 commit comments