mirror of
https://gitee.com/openharmony/applications_app_samples
synced 2024-11-24 00:50:03 +00:00
!4563 多选拖拽Sample 增加menu菜单
Merge pull request !4563 from bd/multiselectdrag
This commit is contained in:
commit
463a16ea1a
@ -36,6 +36,17 @@ export struct MultiSelectDrag {
|
||||
@State previewData: DragItemInfo[] = [{}, {}, {}, {}, {}, {}, {}, {}, {}];
|
||||
@State pixmap: image.PixelMap | undefined = undefined;
|
||||
|
||||
@Builder
|
||||
MenuBuilder() {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||
Button('Test ContextMenu1')
|
||||
Divider().strokeWidth(2).margin(5).color(Color.Black)
|
||||
Button('Test ContextMenu2')
|
||||
Divider().strokeWidth(2).margin(5).color(Color.Black)
|
||||
Button('Test ContextMenu3')
|
||||
}
|
||||
}
|
||||
|
||||
@Builder
|
||||
createGrid() {
|
||||
Grid() {
|
||||
@ -68,6 +79,7 @@ export struct MultiSelectDrag {
|
||||
.dragPreviewOptions({
|
||||
mode: [DragPreviewMode.ENABLE_DEFAULT_SHADOW, DragPreviewMode.ENABLE_DEFAULT_RADIUS]
|
||||
}, { isMultiSelectionEnabled: true, defaultAnimationBeforeLifting: true })
|
||||
.bindContextMenu(this.MenuBuilder, ResponseType.LongPress, { preview: MenuPreviewMode.NONE })
|
||||
.dragPreview(`gridItemId${index}`)
|
||||
.onDragStart(() => {
|
||||
|
||||
|
@ -3538,7 +3538,8 @@ export default function abilityTest() {
|
||||
await checkButtonAndClickWithID('gridItemId1');
|
||||
await checkButtonAndClickWithID('gridItemId3');
|
||||
await checkButtonAndClickWithID('gridItemId4');
|
||||
await checkButtonAndDragToTargetWithID('gridItemId0', column);
|
||||
let gridItemId8 = await driver.findComponent(ON.id('gridItemId8'));
|
||||
await checkButtonAndDragToTargetWithID('gridItemId0', gridItemId8);
|
||||
|
||||
// 滑动slider调整 固定坐标只支持RK3568,其他设备需要调整
|
||||
await driver.drag(660, 600, 660, 0);
|
||||
|
Binary file not shown.
BIN
code/UI/ArkTsComponentCollection/ComponentCollection/lib/DragEvent-1.0.0.tgz
(Stored with Git LFS)
BIN
code/UI/ArkTsComponentCollection/ComponentCollection/lib/DragEvent-1.0.0.tgz
(Stored with Git LFS)
Binary file not shown.
Loading…
Reference in New Issue
Block a user