Skip to content

MOBILEWEBVIEW-75: fix back button for modal window#686

Merged
sergeysozinov merged 1 commit intomission/webview-inappfrom
feature/MOBILEWEBVIEW-75
Mar 5, 2026
Merged

MOBILEWEBVIEW-75: fix back button for modal window#686
sergeysozinov merged 1 commit intomission/webview-inappfrom
feature/MOBILEWEBVIEW-75

Conversation

@sergeysozinov
Copy link
Collaborator

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates in-app back button handling to properly dismiss modal windows by switching from view-level key interception to OnBackPressedDispatcher callbacks.

Changes:

  • Removed legacy back-button interception (BackButtonLayout / BackButtonHandler) from InAppConstraintLayout.
  • Added OnBackPressedCallback registration/cleanup to dismiss modal in-apps on system back.
  • Removed obsolete dismiss-listener binding from WebViewInAppViewHolder (now a no-op bind()).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/WebViewInappViewHolder.kt Drops old dismiss-listener binding; bind() becomes empty.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/ModalWindowInAppViewHolder.kt Registers an OnBackPressedCallback on show and removes it on hide to dismiss modal on back press.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/InAppConstraintLayout.kt Removes key-event based back handling previously used for dismissal.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackButtonLayout.kt Deleted (no longer used).
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackButtonHandler.kt Deleted (no longer used).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergeysozinov sergeysozinov requested a review from enotniy March 4, 2026 08:37
@sergeysozinov sergeysozinov merged commit fc8de01 into mission/webview-inapp Mar 5, 2026
8 checks passed
@sergeysozinov sergeysozinov deleted the feature/MOBILEWEBVIEW-75 branch March 5, 2026 11:29
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