mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-11-18 20:07:55 +00:00
Splash screen may be dismissable (or not)
This commit is contained in:
parent
9b56050c1e
commit
d0319bd2ff
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user