Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {

defaultConfig {
applicationId "com.dozingcatsoftware.bouncy"
minSdkVersion 4
minSdkVersion 9
targetSdkVersion 34
versionCode 38
versionName "1.13.0"
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/com/dozingcatsoftware/bouncy/BouncyActivity.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.dozingcatsoftware.bouncy;

import static android.view.KeyEvent.KEYCODE_BUTTON_A;
import static com.dozingcatsoftware.bouncy.FieldViewManager.LEFT_FLIPPER_KEYS;
import static com.dozingcatsoftware.bouncy.FieldViewManager.RIGHT_FLIPPER_KEYS;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
Expand Down Expand Up @@ -318,16 +322,20 @@ else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
}
// When showing the main menu, switch tables with the flipper buttons.
if (!field.getGameState().isGameInProgress() && buttonPanel.getVisibility() == View.VISIBLE) {
if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
if (LEFT_FLIPPER_KEYS.contains(keyCode)) {
doPreviousTable(null);
startGameButton.requestFocus();
return true;
}
if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
if (RIGHT_FLIPPER_KEYS.contains(keyCode)) {
doNextTable(null);
startGameButton.requestFocus();
return true;
}
if (keyCode == KEYCODE_BUTTON_A) {
doStartGame(null);
return true;
}
}
return super.onKeyDown(keyCode, event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ private void updateFlippersFromTouchEvent(boolean left, boolean right) {
}

static List<Integer> LEFT_FLIPPER_KEYS = Arrays.asList(
KeyEvent.KEYCODE_Z, KeyEvent.KEYCODE_DPAD_LEFT);
KeyEvent.KEYCODE_Z, KeyEvent.KEYCODE_DPAD_LEFT, KeyEvent.KEYCODE_BUTTON_L1);
static List<Integer> RIGHT_FLIPPER_KEYS = Arrays.asList(
KeyEvent.KEYCODE_SLASH, KeyEvent.KEYCODE_DPAD_RIGHT);
KeyEvent.KEYCODE_SLASH, KeyEvent.KEYCODE_DPAD_RIGHT, KeyEvent.KEYCODE_BUTTON_R1);
static List<Integer> ALL_FLIPPER_KEYS = Arrays.asList(
KeyEvent.KEYCODE_SPACE, KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_DPAD_CENTER);

Expand Down