From 5859dabd0378502ec5dd531b946da2f46a5044c5 Mon Sep 17 00:00:00 2001 From: DevKumar00001 Date: Thu, 23 Nov 2023 16:10:34 +0530 Subject: [PATCH] fix(index): Prevent side attachable block from adding at index 0 --- .../java/com/dragon/ide/ui/activities/EventEditorActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/dragon/ide/ui/activities/EventEditorActivity.java b/app/src/main/java/com/dragon/ide/ui/activities/EventEditorActivity.java index 8f6738f..4a8e04a 100644 --- a/app/src/main/java/com/dragon/ide/ui/activities/EventEditorActivity.java +++ b/app/src/main/java/com/dragon/ide/ui/activities/EventEditorActivity.java @@ -550,6 +550,9 @@ public boolean onDrag(View v, DragEvent dragEvent) { attachableBlockView.setEnableEdit(true); attachableBlockView.setBlock(blockDefaultView.getBlock()); } + if (index == 0) { + index = 1; + } ((ViewGroup) v).addView(attachableBlockView, index); Utils.setMargins(attachableBlockView, -16, 0, 0, 0); }