mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-13 12:31:25 +00:00
Check if parent view exists as proxy for isShowing
This commit is contained in:
parent
844d8b815b
commit
38dce3e212
@ -43,7 +43,7 @@ public abstract class Apple2AbstractMenu implements Apple2MenuView {
|
||||
setup();
|
||||
}
|
||||
|
||||
public synchronized void show() {
|
||||
public void show() {
|
||||
if (isShowing()) {
|
||||
return;
|
||||
}
|
||||
@ -59,7 +59,7 @@ public abstract class Apple2AbstractMenu implements Apple2MenuView {
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mSettingsView.isShown();
|
||||
return mSettingsView.getParent() != null;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
|
@ -582,8 +582,9 @@ public class Apple2Activity extends Activity {
|
||||
// Actually remove View from view hierarchy
|
||||
{
|
||||
View menuView = apple2MenuView.getView();
|
||||
if (menuView.isShown()) {
|
||||
((ViewGroup) menuView.getParent()).removeView(menuView);
|
||||
ViewGroup viewGroup = (ViewGroup) menuView.getParent();
|
||||
if (viewGroup != null) {
|
||||
viewGroup.removeView(menuView);
|
||||
}
|
||||
if (apple2MenuView == mSplashScreen) {
|
||||
mSplashScreen = null;
|
||||
|
@ -184,7 +184,7 @@ public class Apple2DisksMenu implements Apple2MenuView {
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mDisksView.isShown();
|
||||
return mDisksView.getParent() != null;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
|
@ -114,7 +114,7 @@ public class Apple2JoystickCalibration implements Apple2MenuView {
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mSettingsView.isShown();
|
||||
return mSettingsView.getParent() != null;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
|
@ -119,7 +119,7 @@ public class Apple2KeypadChooser implements Apple2MenuView {
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mSettingsView.isShown();
|
||||
return mSettingsView.getParent() != null;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
|
@ -71,7 +71,7 @@ public class Apple2SplashScreen implements Apple2MenuView {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
public synchronized void show() {
|
||||
public void show() {
|
||||
if (isShowing()) {
|
||||
return;
|
||||
}
|
||||
@ -87,7 +87,7 @@ public class Apple2SplashScreen implements Apple2MenuView {
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mSettingsView.isShown();
|
||||
return mSettingsView.getParent() != null;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user