/** Update the menu item tool tips. */ @Override protected void updateMenuToolTips() { super.updateMenuToolTips(); UserPrefs prefs = UserPrefs.getInstance(); updateMenuToolTip( pApplyItem, prefs.getApplyChanges(), "Apply the changes to the working version."); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); use25fps = Build.DEVICE.equals("bravo"); // Log.d("Build", "Its a " + Build.DEVICE); Analytics.trackPageView(getApplicationContext(), "/start"); setContentView(R.layout.activity_beebdroid); setAdVisibility(); DPI_MULT = getResources().getDisplayMetrics().density; DP_SCREEN_WIDTH = getResources().getDisplayMetrics().widthPixels; // Detect the Xperia Play, for which we do special magic if (Build.DEVICE.equalsIgnoreCase("R800i") || Build.DEVICE.equalsIgnoreCase("zeus")) { isXperiaPlay = true; } // Find UI bits and wire things up beebView = (BeebView) findViewById(R.id.beeb); keyboard = (Keyboard) findViewById(R.id.keyboard); keyboard.beebdroid = this; controller = (ControllerView) findViewById(R.id.controller); controller.beebdroid = this; // See if we're a previous instance of the same activity, or a totally fresh one Beebdroid prev = (Beebdroid) getLastNonConfigurationInstance(); if (prev == null) { InstalledDisks.load(this); audiobuff = new byte[2000 * 2]; audio = new AudioTrack( AudioManager.STREAM_MUSIC, 31250, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, 16384, AudioTrack.MODE_STREAM); model = new Model(); model.loadRoms(this, Model.SupportedModels[1]); bbcInit(model.mem, model.roms, audiobuff, 1); currentController = Controllers.DEFAULT_CONTROLLER; if (UserPrefs.shouldShowSplashScreen(this)) { startActivity(new Intent(Beebdroid.this, AboutActivity.class)); } processDiskViaIntent(); } else { model = prev.model; audio = prev.audio; audiobuff = prev.audiobuff; diskInfo = prev.diskInfo; last_trigger = prev.last_trigger; keyboardTextWait = prev.keyboardTextWait; keyboardTextEvents = prev.keyboardTextEvents; keyboardShowing = prev.keyboardShowing; currentController = prev.currentController; bbcInit(model.mem, model.roms, audiobuff, 0); } setController(currentController); showKeyboard(keyboardShowing); // Wire up the white buttons final ImageView btnInput = (ImageView) findViewById(R.id.btnInput); if (btnInput != null) { btnInput.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { toggleKeyboard(); } }); } tvFps = (TextView) findViewById(R.id.fps); beebView.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { bbcKeyEvent(BeebKeys.BBCKEY_CTRL, 0, 1); bbcKeyEvent(BeebKeys.BBCKEY_SPACE, 0, 1); handler.postDelayed( new Runnable() { @Override public void run() { bbcKeyEvent(BeebKeys.BBCKEY_CTRL, 0, 0); bbcKeyEvent(BeebKeys.BBCKEY_SPACE, 0, 0); } }, 50); hintActioned("hint_space_to_start"); } }); UserPrefs.setGrandfatheredIn(this, true); }