Showing
1 changed file
with
32 additions
and
33 deletions
| @@ -287,16 +287,6 @@ struct ChannelDialog { | @@ -287,16 +287,6 @@ struct ChannelDialog { | ||
| 287 | .height('100%') | 287 | .height('100%') |
| 288 | .justifyContent(FlexAlign.Center) | 288 | .justifyContent(FlexAlign.Center) |
| 289 | .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff') | 289 | .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff') |
| 290 | - .onClick(() => { | ||
| 291 | - if (this.isEditIng) { | ||
| 292 | - if (item.delPermitted === 1) { | ||
| 293 | - this.delChannelItem(index) | ||
| 294 | - } | ||
| 295 | - } else { | ||
| 296 | - this.confirm(index) | ||
| 297 | - this.controller?.close() | ||
| 298 | - } | ||
| 299 | - }) | ||
| 300 | } | 290 | } |
| 301 | .width('23%') | 291 | .width('23%') |
| 302 | .height(40) | 292 | .height(40) |
| @@ -307,31 +297,40 @@ struct ChannelDialog { | @@ -307,31 +297,40 @@ struct ChannelDialog { | ||
| 307 | }) | 297 | }) |
| 308 | .zIndex(this.dragItem == item.num ? 1 : 0) | 298 | .zIndex(this.dragItem == item.num ? 1 : 0) |
| 309 | .translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 }) | 299 | .translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 }) |
| 310 | - | ||
| 311 | .gesture( | 300 | .gesture( |
| 312 | - GestureGroup(GestureMode.Sequence, | ||
| 313 | - PanGesture({ fingers: 1, direction: null, distance: 0 }) | ||
| 314 | - .onActionStart((event: GestureEvent) => { | ||
| 315 | - this.dragItem = item.num | ||
| 316 | - this.dragRefOffsetX = 0 | ||
| 317 | - this.dragRefOffsetY = 0 | ||
| 318 | - }) | ||
| 319 | - .onActionUpdate((event: GestureEvent) => { | ||
| 320 | - animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 321 | - this.handleAnimationTo(item, event) | ||
| 322 | - }) | ||
| 323 | - }) | ||
| 324 | - .onActionEnd((event: GestureEvent) => { | ||
| 325 | - animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 326 | - this.dragItem = -1 | ||
| 327 | - this.offsetX = 0 | ||
| 328 | - this.offsetY = 0 | 301 | + GestureGroup(GestureMode.Sequence, |
| 302 | + TapGesture() | ||
| 303 | + .onAction((event?: GestureEvent) => { | ||
| 304 | + if (this.isEditIng) { | ||
| 305 | + if (item.delPermitted === 1) { | ||
| 306 | + this.delChannelItem(index) | ||
| 307 | + } | ||
| 308 | + } else { | ||
| 309 | + this.confirm(index) | ||
| 310 | + this.controller?.close() | ||
| 311 | + } | ||
| 312 | + }), | ||
| 313 | + PanGesture({ fingers: 1, direction: null, distance: 0 }) | ||
| 314 | + .onActionStart((event: GestureEvent) => { | ||
| 315 | + this.dragItem = item.num | ||
| 329 | this.dragRefOffsetX = 0 | 316 | this.dragRefOffsetX = 0 |
| 330 | this.dragRefOffsetY = 0 | 317 | this.dragRefOffsetY = 0 |
| 331 | }) | 318 | }) |
| 332 | - }) | ||
| 333 | - ) | ||
| 334 | - .onCancel(() => { | 319 | + .onActionUpdate((event: GestureEvent) => { |
| 320 | + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 321 | + this.handleAnimationTo(item, event) | ||
| 322 | + }) | ||
| 323 | + }) | ||
| 324 | + .onActionEnd((event: GestureEvent) => { | ||
| 325 | + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 326 | + this.dragItem = -1 | ||
| 327 | + this.offsetX = 0 | ||
| 328 | + this.offsetY = 0 | ||
| 329 | + this.dragRefOffsetX = 0 | ||
| 330 | + this.dragRefOffsetY = 0 | ||
| 331 | + }) | ||
| 332 | + }) | ||
| 333 | + ).onCancel(() => { | ||
| 335 | animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | 334 | animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { |
| 336 | this.dragItem = -1 | 335 | this.dragItem = -1 |
| 337 | this.offsetX = 0 | 336 | this.offsetX = 0 |
| @@ -339,8 +338,8 @@ struct ChannelDialog { | @@ -339,8 +338,8 @@ struct ChannelDialog { | ||
| 339 | this.dragRefOffsetX = 0 | 338 | this.dragRefOffsetX = 0 |
| 340 | this.dragRefOffsetY = 0 | 339 | this.dragRefOffsetY = 0 |
| 341 | }) | 340 | }) |
| 342 | - })) | ||
| 343 | - | 341 | + }) |
| 342 | + ) | ||
| 344 | }, (item: TopNavDTO) => JSON.stringify(item)) | 343 | }, (item: TopNavDTO) => JSON.stringify(item)) |
| 345 | } | 344 | } |
| 346 | .width('100%') | 345 | .width('100%') |
-
Please register or login to post a comment