Commit 39a6df5 1 parent f8a7c5c commit 39a6df5 Copy full SHA for 39a6df5
File tree 1 file changed +21
-1
lines changed
CodenameOne/src/com/codename1/ui
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1431,6 +1431,8 @@ public SwipeListener(int type) {
1431
1431
this .type = type ;
1432
1432
}
1433
1433
1434
+
1435
+
1434
1436
public void actionPerformed (ActionEvent evt ) {
1435
1437
1436
1438
if (getComponentCount () == 0 || !swipeActivated ||slideToDestMotion != null ) {
@@ -1442,7 +1444,7 @@ public void actionPerformed(ActionEvent evt) {
1442
1444
case PRESS : {
1443
1445
blockSwipe = false ;
1444
1446
riskySwipe = false ;
1445
- if (contentPane .visibleBoundsContains (x , y )) {
1447
+ if (! isEventBlockedByHigherComponent ( evt ) && contentPane .visibleBoundsContains (x , y )) {
1446
1448
Component testCmp = contentPane .getComponentAt (x , y );
1447
1449
if (testCmp != null && testCmp != contentPane ) {
1448
1450
doNotBlockSideSwipe = true ;
@@ -1656,6 +1658,24 @@ public void actionPerformed(ActionEvent evt) {
1656
1658
}
1657
1659
}
1658
1660
}
1661
+
1662
+ private boolean isEventBlockedByHigherComponent (ActionEvent evt ) {
1663
+ final int x = evt .getX ();
1664
+ final int y = evt .getY ();
1665
+ final Form currentForm = Display .INSTANCE .getCurrent ();
1666
+ if (currentForm == null ) {
1667
+ return false ;
1668
+ }
1669
+ final Component targetComponent = currentForm .getComponentAt (x , y );
1670
+ if (targetComponent == null ) {
1671
+ return false ;
1672
+ }
1673
+ if (contentPane .equals (targetComponent ) || contentPane .contains (targetComponent )) {
1674
+ return false ;
1675
+ }
1676
+
1677
+ return true ;
1678
+ }
1659
1679
}
1660
1680
1661
1681
/**
You can’t perform that action at this time.
0 commit comments