Splash screen may be dismissable (or not)

This commit is contained in:
Aaron Culliney 2015-11-03 22:29:19 -08:00
parent 9b56050c1e
commit d0319bd2ff
2 changed files with 22 additions and 3 deletions

View File

@ -419,7 +419,7 @@ public class Apple2Activity extends Activity {
if (mSplashScreen != null) {
return;
}
mSplashScreen = new Apple2SplashScreen(Apple2Activity.this);
mSplashScreen = new Apple2SplashScreen(this, /*dismissable:*/true);
mSplashScreen.show();
}

View File

@ -23,11 +23,13 @@ public class Apple2SplashScreen implements Apple2MenuView {
private final static String TAG = "Apple2SplashScreen";
private Apple2Activity mActivity = null;
private boolean mDismissable = true;
private View mSettingsView = null;
public Apple2SplashScreen(Apple2Activity activity) {
public Apple2SplashScreen(Apple2Activity activity, boolean dismissable) {
mActivity = activity;
setup();
setDismissable(dismissable);
}
private void setup() {
@ -61,6 +63,21 @@ public class Apple2SplashScreen implements Apple2MenuView {
});
}
public void setDismissable(boolean dismissable) {
mDismissable = dismissable;
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Button startButton = (Button) mSettingsView.findViewById(R.id.startButton);
startButton.setEnabled(mDismissable);
Button prefsButton = (Button) mSettingsView.findViewById(R.id.prefsButton);
prefsButton.setEnabled(mDismissable);
Button disksButton = (Button) mSettingsView.findViewById(R.id.disksButton);
disksButton.setEnabled(mDismissable);
}
});
}
public final boolean isCalibrating() {
return false;
}
@ -77,7 +94,9 @@ public class Apple2SplashScreen implements Apple2MenuView {
}
public void dismiss() {
mActivity.popApple2View(this);
if (mDismissable) {
mActivity.popApple2View(this);
}
}
public void dismissAll() {