Skip to content

MOBILEWEBVIEW-126: change back action handler#697

Open
sergeysozinov wants to merge 3 commits intomission/webview-inappfrom
feature/MOBILEWEBVIEW-126
Open

MOBILEWEBVIEW-126: change back action handler#697
sergeysozinov wants to merge 3 commits intomission/webview-inappfrom
feature/MOBILEWEBVIEW-126

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

Updates in-app back navigation handling by replacing OnBackPressedCallback usage with a custom back-press registration mechanism that combines layout key-event interception and Android 13+ system back callbacks.

Changes:

  • Introduced BackPressRegistrar / BackRegistration abstractions and wired them into MindboxView.
  • Added BackButtonLayout + BackButtonHandler and implemented them in InAppConstraintLayout to intercept BACK key events.
  • Updated WebView and Modal in-app view holders to bind back actions via AbstractInAppViewHolder.bindBackAction.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/WebViewInappViewHolder.kt Switches WebView in-app back handling to bindBackAction (removes OnBackPressedCallback).
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/ModalWindowInAppViewHolder.kt Switches modal in-app back handling to bindBackAction (removes OnBackPressedCallback).
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/InAppConstraintLayout.kt Adds BACK key interception and supports BackButtonLayout.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackPressRegistrar.kt New registrar that wires layout back listener + Android 13+ OnBackInvokedCallback.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackButtonLayout.kt New interface for layouts that can accept a back listener.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackButtonHandler.kt New helper to consume only valid BACK/ACTION_UP events.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/AbstractInAppViewHolder.kt Adds centralized back registration lifecycle management.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/InAppMessageViewDisplayerImpl.kt Replaces registerBack API with backPressRegistrar on MindboxView.

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

@sergeysozinov sergeysozinov requested a review from enotniy March 24, 2026 12:43
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