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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Versions after 2.17 are `MAJOR.MINOR.PATCH` (2.17 is followed by 2.17.1 or 2.18.
`docs/testing.md`, "Versions and releases"); the headings below keep the numbers as they
were released.

## 2.20.1 — 2026-11-04

- On Android 5 **Back** closes the open menu again; it did nothing, only OK or Esc closed it
(#265).

## 2.20.0 — 2026-11-02

- A remote with only a D-pad now reaches the actions that were touch-only (#263). With the
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId "com.openipc.decoder"
minSdk 21
targetSdk 36
versionCode 50
versionName "2.20.0"
versionCode 51
versionName "2.20.1"

buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
}
Expand Down
19 changes: 14 additions & 5 deletions android/app/src/main/java/com/openipc/decoder/MenuManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.app.AlertDialog;
import android.app.Dialog;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Build;
Expand Down Expand Up @@ -162,15 +163,24 @@ private void track(Dialog dialog) {
});
}

/**
* A focusable popup that closes on Back. Below Android 6 a popup takes Back only with a
* background of its own (#265), so it gets a transparent one.
*/
private PopupWindow menuPopup(View content) {
PopupWindow popup = new PopupWindow(content, LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT, true);
popup.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
return popup;
}

void showMenu(View anchor, boolean quadEnabled, int mActive, String version,
String gitHash, String[] mHosts) {
boolean single = !quadEnabled && !udpShown;
if (mMenuIsCached) {
updateCachedMenu(quadEnabled, mActive, mHosts);
if (mMenuPopup != null) return;
mMenuPopup = new PopupWindow(mMenuLayout,
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT, true);
mMenuPopup = menuPopup(mMenuLayout);
int margin = dp(12);
mMenuPopup.showAtLocation(anchor, Gravity.TOP | Gravity.START, margin, margin);
mMenuPopup.setOnDismissListener(() -> mMenuPopup = null);
Expand Down Expand Up @@ -203,8 +213,7 @@ public boolean dispatchKeyEvent(KeyEvent event) {
layout.setOrientation(LinearLayout.VERTICAL);
layout.setFocusableInTouchMode(true);

PopupWindow popup = new PopupWindow(layout, LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT, true);
PopupWindow popup = menuPopup(layout);
int margin = dp(12);
popup.showAtLocation(anchor, Gravity.TOP | Gravity.START, margin, margin);
mMenuPopup = popup;
Expand Down
Loading