Android: show the stream menu on Back #827

Open
aoleg94 wants to merge 1 commit from aoleg94/android-fix-overlay into main
aoleg94 commented 2026-10-03 17:41:50 -05:00 (Migrated from github.com)

Summary

Same problem as #819: with BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE the app is never told when an
edge swipe reveals the bars, so the stream menu (on-screen controls / touchpad-only switches,
display mode) can't be opened. I reached the same conclusion about BEHAVIOR_DEFAULT (the
swipe goes on to the home gesture).

This PR uses Back instead of a new button: Back opens the menu, Back while it is open leaves
the stream
(before, Back always left). It needs no setting and works with gesture, 3-button
navigation and a mouse's back button. The menu hides on its own 2 s timer, as the bars hiding
isn't reported either; #819 makes the same timer change.

It complements #819 rather than replacing it: the button is still useful for users who want a
visible control. If #819 lands first I'll rebase onto it (both touch hideSystemUIRunnable).

Implementation

  • StreamBackCallback (OnBackPressedCallback): overlay hidden → show it, shown → leave.
  • hideSystemUIRunnable also hides the overlay.

Testing

  • New StreamBackCallbackTest through a real OnBackPressedDispatcher.
    ./gradlew testDebugUnitTest passes.
  • Galaxy Z Fold 4 (gesture navigation) + PS5: Back opens the menu, switches work, Back again
    leaves. With gesture navigation the first side swipe only reveals the transient bars; the
    second is Back.

Notes

Developed with the assistance of Claude Code, and tested on real hardware as described above.

🤖 Generated with Claude Code

### Summary Same problem as #819: with `BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE` the app is never told when an edge swipe reveals the bars, so the stream menu (on-screen controls / touchpad-only switches, display mode) can't be opened. I reached the same conclusion about `BEHAVIOR_DEFAULT` (the swipe goes on to the home gesture). This PR uses Back instead of a new button: **Back opens the menu, Back while it is open leaves the stream** (before, Back always left). It needs no setting and works with gesture, 3-button navigation and a mouse's back button. The menu hides on its own 2 s timer, as the bars hiding isn't reported either; #819 makes the same timer change. It complements #819 rather than replacing it: the button is still useful for users who want a visible control. If #819 lands first I'll rebase onto it (both touch `hideSystemUIRunnable`). ### Implementation - `StreamBackCallback` (`OnBackPressedCallback`): overlay hidden → show it, shown → leave. - `hideSystemUIRunnable` also hides the overlay. ### Testing - New `StreamBackCallbackTest` through a real `OnBackPressedDispatcher`. `./gradlew testDebugUnitTest` passes. - Galaxy Z Fold 4 (gesture navigation) + PS5: Back opens the menu, switches work, Back again leaves. With gesture navigation the first side swipe only reveals the transient bars; the second is Back. ### Notes Developed with the assistance of Claude Code, and tested on real hardware as described above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'aoleg94/android-fix-overlay:aoleg94/android-fix-overlay'
git switch 'aoleg94/android-fix-overlay'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'aoleg94/android-fix-overlay'
git switch 'aoleg94/android-fix-overlay'
git rebase 'main'
git switch 'main'
git merge --ff-only 'aoleg94/android-fix-overlay'
git switch 'aoleg94/android-fix-overlay'
git rebase 'main'
git switch 'main'
git merge --no-ff 'aoleg94/android-fix-overlay'
git switch 'main'
git merge --squash 'aoleg94/android-fix-overlay'
git switch 'main'
git merge --ff-only 'aoleg94/android-fix-overlay'
git switch 'main'
git merge 'aoleg94/android-fix-overlay'
git push origin 'main'
Sign in to join this conversation.
No description provided.