MOBILEWEBVIEW-126: change back action handler#697
Open
sergeysozinov wants to merge 3 commits intomission/webview-inappfrom
Open
MOBILEWEBVIEW-126: change back action handler#697sergeysozinov wants to merge 3 commits intomission/webview-inappfrom
sergeysozinov wants to merge 3 commits intomission/webview-inappfrom
Conversation
There was a problem hiding this comment.
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/BackRegistrationabstractions and wired them intoMindboxView. - Added
BackButtonLayout+BackButtonHandlerand implemented them inInAppConstraintLayoutto 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.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackButtonHandler.kt
Show resolved
Hide resolved
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackPressRegistrar.kt
Show resolved
Hide resolved
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackPressRegistrar.kt
Show resolved
Hide resolved
enotniy
approved these changes
Mar 24, 2026
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackButtonLayout.kt
Show resolved
Hide resolved
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/BackPressRegistrar.kt
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://tracker.yandex.ru/MOBILE-38