Skip to content

android(fix): back button/gesture doesn't exit the app from the root screen - #809

Open
QuerTeal wants to merge 1 commit into
librepods-org:android/rewritefrom
QuerTeal:fix/back-exits-app
Open

QuerTeal wants to merge 1 commit into
librepods-org:android/rewritefrom
QuerTeal:fix/back-exits-app

Conversation

@QuerTeal

Copy link
Copy Markdown

Summary

Pressing back on the root screen did nothing: the app never closed.

Cause:

  • SwipeBackSceneContent registers a PredictiveBackHandler that is always enabled. On the root entry (no previousEntry) it still consumed the back event, then only animated and called an onDismiss that did nothing.
  • The onboarding BackHandler had the same problem on its first page.

Fix:

  • PredictiveBackHandler(enabled = previousEntry != null).
  • BackHandler(enabled = state.canScrollBackward) in onboarding.

Testing

On a Galaxy S26 Ultra (One UI 9.0), with the app open on the device list, I sent adb shell input keyevent KEYCODE_BACK. The top resumed activity changed from me.kavishdevar.librepods/.presentation.activities.MainActivity to the launcher.

The onboarding change hasn't been exercised on the device yet; it has only been built.

🤖 Generated with Claude Code

SwipeBackSceneContent registers a PredictiveBackHandler that is always
enabled. On the root screen (no previous entry) it still consumed the
back gesture/button, so pressing back did nothing instead of leaving the
app. Only enable it when there is a previous entry to go back to.

The onboarding BackHandler had the same problem on its first page;
enable it only while the carousel can scroll backward.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant