Permalink
Browse files

front: Fixed issue that caused more than one pop-up to show up at a t…

…ime in the

touch screen profile activity.
  • Loading branch information...
fzurita committed Dec 18, 2015
1 parent 0c6b7cc commit cf6cf04493a2d0c36b8dc14047fcac49c8f40954
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/paulscode/android/mupen64plusae/profile/TouchscreenProfileActivity.java
@@ -122,6 +122,9 @@
// True if the touchscreen joystick is animated
private boolean isTouchscreenAnimated;
// This is to prevent more than one popup appearing at once
private boolean mPopupBeingShown;
@SuppressLint( "ClickableViewAccessibility" )
@Override
protected void onCreate( Bundle savedInstanceState )
@@ -203,6 +206,8 @@ public void onMenuVisibilityChanged( boolean isVisible )
// Initialize the touchmap and overlay
mTouchscreenMap = new VisibleTouchMap( getResources() );
mOverlay.setOnTouchListener( this );
mPopupBeingShown = false;
}
private void refresh()
@@ -586,6 +591,14 @@ else if( dragIndex != TouchMap.UNMAPPED )
private void popupDialog( final String assetName, String title, final int holdableIndex )
{
//Prevent more than one pop at a time
if(mPopupBeingShown)
{
return;
}
mPopupBeingShown = true;
// Get the original position of the asset
final int initialX = mProfile.getInt( assetName + TAG_X, INITIAL_ASSET_POS );
final int initialY = mProfile.getInt( assetName + TAG_Y, INITIAL_ASSET_POS );
@@ -693,6 +706,8 @@ else if( which == DialogInterface.BUTTON_NEUTRAL )
// Remove the asset from this profile
toggleAsset( assetName );
}
mPopupBeingShown = false;
}
};

0 comments on commit cf6cf04

Please sign in to comment.