Showing
1 changed file
with
43 additions
and
35 deletions
| @@ -298,47 +298,55 @@ struct ChannelDialog { | @@ -298,47 +298,55 @@ struct ChannelDialog { | ||
| 298 | .zIndex(this.dragItem == item.num ? 1 : 0) | 298 | .zIndex(this.dragItem == item.num ? 1 : 0) |
| 299 | .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 }) |
| 300 | .gesture( | 300 | .gesture( |
| 301 | - GestureGroup(GestureMode.Parallel, | ||
| 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() | 301 | + GestureGroup(GestureMode.Parallel, |
| 302 | + TapGesture() | ||
| 303 | + .onAction((event?: GestureEvent) => { | ||
| 304 | + if (this.isEditIng) { | ||
| 305 | + if (item.delPermitted === 1) { | ||
| 306 | + this.delChannelItem(index) | ||
| 311 | } | 307 | } |
| 312 | - }), | ||
| 313 | - PanGesture({ fingers: 1, direction: null, distance: 0 }) | ||
| 314 | - .onActionStart((event: GestureEvent) => { | ||
| 315 | - this.dragItem = item.num | 308 | + } else { |
| 309 | + this.confirm(index) | ||
| 310 | + this.controller?.close() | ||
| 311 | + } | ||
| 312 | + }), | ||
| 313 | + LongPressGesture({ repeat: true }) | ||
| 314 | + .onAction((event: GestureEvent | undefined) => { | ||
| 315 | + if (event) { | ||
| 316 | + if (event.repeat && this.isEditIng === false) { | ||
| 317 | + this.isEditIng = true; | ||
| 318 | + } | ||
| 319 | + } | ||
| 320 | + }), | ||
| 321 | + PanGesture({ fingers: 1, direction: null, distance: 0 }) | ||
| 322 | + .onActionStart((event: GestureEvent) => { | ||
| 323 | + this.dragItem = item.num | ||
| 324 | + this.dragRefOffsetX = 0 | ||
| 325 | + this.dragRefOffsetY = 0 | ||
| 326 | + }) | ||
| 327 | + .onActionUpdate((event: GestureEvent) => { | ||
| 328 | + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 329 | + this.handleAnimationTo(item, event) | ||
| 330 | + }) | ||
| 331 | + }) | ||
| 332 | + .onActionEnd((event: GestureEvent) => { | ||
| 333 | + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 334 | + this.dragItem = -1 | ||
| 335 | + this.offsetX = 0 | ||
| 336 | + this.offsetY = 0 | ||
| 316 | this.dragRefOffsetX = 0 | 337 | this.dragRefOffsetX = 0 |
| 317 | this.dragRefOffsetY = 0 | 338 | this.dragRefOffsetY = 0 |
| 318 | }) | 339 | }) |
| 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(() => { | ||
| 334 | - animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 335 | - this.dragItem = -1 | ||
| 336 | - this.offsetX = 0 | ||
| 337 | - this.offsetY = 0 | ||
| 338 | - this.dragRefOffsetX = 0 | ||
| 339 | - this.dragRefOffsetY = 0 | ||
| 340 | }) | 340 | }) |
| 341 | + ).onCancel(() => { | ||
| 342 | + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 343 | + this.dragItem = -1 | ||
| 344 | + this.offsetX = 0 | ||
| 345 | + this.offsetY = 0 | ||
| 346 | + this.dragRefOffsetX = 0 | ||
| 347 | + this.dragRefOffsetY = 0 | ||
| 341 | }) | 348 | }) |
| 349 | + }) | ||
| 342 | ) | 350 | ) |
| 343 | }, (item: TopNavDTO) => JSON.stringify(item)) | 351 | }, (item: TopNavDTO) => JSON.stringify(item)) |
| 344 | } | 352 | } |
-
Please register or login to post a comment