Skip to content

2.20.1: Back closes the menu on Android 5 (#265) - #266

Merged
compot-dev merged 1 commit into
v2from
fix/menu-back-265
Nov 4, 2026
Merged

compot-dev merged 1 commit into
v2from
fix/menu-back-265

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Fixes #265.

Below Android 6 a PopupWindow wraps its content in the view that handles Back only when it has a background. The menu popups had none, so Back did nothing. Both places that create the menu now use one helper that sets a transparent background.

Checked on emulators: API 21 before the fix — focus stays on the popup after Back, as reported; after it — Back and Esc close the menu, and the menu looks the same; API 25 — Back closes the menu. Local build, unit tests and lint pass in the CI image.

Version 2.20.1.

Below Android 6 a PopupWindow takes Back only with a background of its own.
The menu popups get a transparent one.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix Android 5 Back dismissal for menu popups

🐞 Bug fix ⚙️ Configuration changes 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Give menu popups a transparent background so Back closes them on Android 5 without changing their
 appearance.
• Apply the fix to both new and cached menus.
• Bump the app version to 2.20.1 and record the fix.
Diagram

graph TD
  A["Show menu"] --> B{"Cached layout?"} -->|Yes| C["Reuse layout"] --> E["Popup helper"] --> F["Focusable popup"] -->|Back| G["Dismiss menu"]
  B -->|No| D["Build layout"] --> E
Loading
High-Level Assessment

Using the platform's popup dismissal behavior through a shared constructor is the smallest fix for both menu paths. Explicitly handling Back in the menu layout would duplicate platform behavior and add key-dispatch complexity.

Files changed (3) +21 / -7

Bug fix (1) +14 / -5
MenuManager.javaMake both menu popups dismissible with Back on Android 5 +14/-5

Make both menu popups dismissible with Back on Android 5

• Adds a shared helper that creates a focusable PopupWindow with a transparent background. Both the cached and newly built menu paths use it so older Android versions handle Back without a visible background change.

android/app/src/main/java/com/openipc/decoder/MenuManager.java

Documentation (1) +5 / -0
CHANGELOG.mdDocument the Android 5 menu fix in 2.20.1 +5/-0

Document the Android 5 menu fix in 2.20.1

• Adds a 2.20.1 entry describing restored Back dismissal for the menu on Android 5 and referencing issue #265.

CHANGELOG.md

Other (1) +2 / -2
build.gradleBump the app release to 2.20.1 +2/-2

Bump the app release to 2.20.1

• Increments versionCode from 50 to 51 and versionName from 2.20.0 to 2.20.1.

android/app/build.gradle

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev
compot-dev merged commit 80ca3e0 into v2 Nov 4, 2026
7 checks passed
@compot-dev
compot-dev deleted the fix/menu-back-265 branch November 4, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android 5.0: Back does not close the open menu

1 participant