Skip to content

feat(app): adding edge gesture handlers#2542

Open
theproducer wants to merge 22 commits into
nextfrom
RMET-5179
Open

feat(app): adding edge gesture handlers#2542
theproducer wants to merge 22 commits into
nextfrom
RMET-5179

Conversation

@theproducer

@theproducer theproducer commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new edgeGesture event that adds support for system edge-swipe gestures on both iOS and Android.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Tests or Reproductions

Screenshots / Media

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

@theproducer theproducer marked this pull request as ready for review June 11, 2026 17:28
@theproducer theproducer requested review from a team and OS-ruimoreiramendes and removed request for a team June 11, 2026 17:28
@github-actions

Copy link
Copy Markdown

Released dev build of app with dev version: 8.1.1-dev-2542-20260611T172948.0

let translation = recognizer.translation(in: view)
let touch = recognizer.location(in: view)
let viewWidth = view.bounds.width
let viewHeight = view.bounds.height

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

viewHeight is declared but never used, can be removed.

});
this.onBackPressedCallback = new OnBackPressedCallback(!disableBackButtonHandler) {
this.backButtonHandlerEnabled = !getConfig().getBoolean("disableBackButtonHandler", false);
this.edgeGestureHandlerEnabled = getConfig().getBoolean("enableEdgeGestureHandler", false);

@OS-ruimoreiramendes OS-ruimoreiramendes Jun 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be an issue here worth investigating.
On Android < 14, if the developer opts into enableEdgeGestureHandler, this assignment makes edgeGestureHandlerEnabled = true. applyBackButtonHandlerState() then disables the backButton handler (via backButtonHandlerEnabled && !edgeGestureHandlerEnabled), but setupBackGestureHandlers() no-ops because OnBackAnimationCallback requires API 34+.

Net effect for users on Android < 14, backButton stops dispatching.

Suggest gating the flag by SDK:

boolean canUseEdgeGesture = Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
this.edgeGestureHandlerEnabled = canUseEdgeGesture && getConfig().getBoolean("enableEdgeGestureHandler", false);

Same fix needed in toggleEdgeGestureHandler .
Could you double-check this scenario? Might be that I'm missing something.


private void applyBackButtonHandlerState() {
if (this.onBackPressedCallback != null) {
this.onBackPressedCallback.setEnabled(backButtonHandlerEnabled && !edgeGestureHandlerEnabled);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tied to the earlier comment on line 53: on Android < 14, if the developer opts into enableEdgeGestureHandler, this line evaluates setEnabled(true && !true) = setEnabled(false) and disables the backButton handler. But setupBackGestureHandlers() no-ops on those versions because OnBackAnimationCallback requires API 34+. backButton stops dispatching.
Silent regression with no error. Gating the flag at assignment (see line 53) would prevent this.

@OS-ruimoreiramendes OS-ruimoreiramendes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the inline comments I left, I tested the changes locally on a test app and everything seems to be working correctly. Nice work overall.

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.

3 participants