From 60b4dbf483f11136a0cc44439c26b811c1fc7a20 Mon Sep 17 00:00:00 2001 From: arpruss Date: Sun, 15 Sep 2019 10:33:21 -0500 Subject: [PATCH] foo --- .../mobi/simplestopwatch/StopWatch.java | 58 +++---------------- app/src/main/res/menu/menu.xml | 1 + 2 files changed, 8 insertions(+), 51 deletions(-) diff --git a/app/src/main/java/omegacentauri/mobi/simplestopwatch/StopWatch.java b/app/src/main/java/omegacentauri/mobi/simplestopwatch/StopWatch.java index dcddb08..22ce684 100755 --- a/app/src/main/java/omegacentauri/mobi/simplestopwatch/StopWatch.java +++ b/app/src/main/java/omegacentauri/mobi/simplestopwatch/StopWatch.java @@ -343,7 +343,7 @@ public void onButtonReset(View v) { public boolean isFirstButton(int keyCode) { return (keyCode == KeyEvent.KEYCODE_VOLUME_UP && options.getBoolean(Options.PREF_VOLUME, true)) || - keyCode == KeyEvent.KEYCODE_DPAD_CENTER || +// keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE; } @@ -382,9 +382,9 @@ else if (isSecondButton(keyCode)) { else if (keyCode == KeyEvent.KEYCODE_MENU) { onButtonMenu(null); } - else if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) { - onButtonSettings(null); - } +// else if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) { +// onButtonSettings(null); +// } return super.onKeyDown(keyCode, event); } @@ -425,6 +425,9 @@ public boolean onOptionsItemSelected(MenuItem item) { case R.id.pace: pace(); return true; + case R.id.go_settings: + onButtonSettings(null); + return true; } return super.onOptionsItemSelected(item); } @@ -550,53 +553,6 @@ public void onCancel(DialogInterface dialogInterface) { debug("pace"); } - public void myMenuChoice(String choice) { - switch (choice) { - case MENU_COPY_TIME: - stopwatch.copyToClipboard(); - break; - case MENU_COPY_LAP: - stopwatch.copyLapsToClipboard(); - break; - case MENU_CLEAR_LAP: - stopwatch.clearLapData(); - break; - case MENU_PACE: - pace(); - break; - } - } - - void myMenu() { - final ArrayList menu = new ArrayList(); - menu.add(MENU_COPY_TIME); - if (stopwatch.lapData.length()>0) { - menu.add(MENU_COPY_LAP); - menu.add(MENU_CLEAR_LAP); - } - if (stopwatch.getTime()>0) - menu.add(MENU_PACE); - - AlertDialog.Builder builder = AlertDialog_Builder(); - final String[] menuArray = new String[menu.size()]; - menu.toArray(menuArray); - builder.setItems(menuArray, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - myMenuChoice(menuArray[i]); - setFullScreen(); - } - }); - builder.setOnCancelListener(new DialogInterface.OnCancelListener() { - @Override - public void onCancel(DialogInterface dialogInterface) { - setFullScreen(); - } - }); - AlertDialog dialog = builder.create(); - dialog.show(); - } - @Override public boolean onPrepareOptionsMenu(Menu menu) { menu.findItem(R.id.copy_laps).setVisible(stopwatch.lapData.length()>0); diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index dfdc454..5364625 100755 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -3,4 +3,5 @@ + \ No newline at end of file