This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Predictive back breakage fix #42789
Merged
Merged
Predictive back breakage fix #42789
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0734cdf
Provide a default implementation to avoid needing to override setFram…
justinmc 782eee5
Docs to explain the empty method
justinmc cb003af
Formatting
justinmc 41b893d
frameworkHandlesBacks => frameworkHandlesBack
justinmc d701c98
Default implementation for source of error, too
justinmc ab5c5cd
Clarify docs
justinmc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,14 @@ public interface PlatformPluginDelegate { | |
| */ | ||
| boolean popSystemNavigator(); | ||
|
|
||
| void setFrameworkHandlesBack(boolean frameworkHandlesBacks); | ||
| /** | ||
| * The Flutter application would or would not like to handle navigation pop events itself. | ||
| * | ||
| * <p>Relevant for registering and unregistering the app's OnBackInvokedCallback for the | ||
| * Predictive Back feature, for example as in {@link | ||
| * io.flutter.embedding.android.FlutterActivity}. | ||
| */ | ||
| default void setFrameworkHandlesBack(boolean frameworkHandlesBack) {} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this works as a good alternative to the empty implementation in |
||
| } | ||
|
|
||
| @VisibleForTesting | ||
|
|
@@ -112,8 +119,8 @@ public void setSystemUiOverlayStyle( | |
| } | ||
|
|
||
| @Override | ||
| public void setFrameworkHandlesBack(boolean frameworkHandlesBacks) { | ||
| PlatformPlugin.this.setFrameworkHandlesBack(frameworkHandlesBacks); | ||
| public void setFrameworkHandlesBack(boolean frameworkHandlesBack) { | ||
| PlatformPlugin.this.setFrameworkHandlesBack(frameworkHandlesBack); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -482,8 +489,8 @@ private void setSystemChromeSystemUIOverlayStyle( | |
| currentTheme = systemChromeStyle; | ||
| } | ||
|
|
||
| private void setFrameworkHandlesBack(boolean frameworkHandlesBacks) { | ||
| platformPluginDelegate.setFrameworkHandlesBack(frameworkHandlesBacks); | ||
| private void setFrameworkHandlesBack(boolean frameworkHandlesBack) { | ||
| platformPluginDelegate.setFrameworkHandlesBack(frameworkHandlesBack); | ||
| } | ||
|
|
||
| private void popSystemNavigator() { | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me since it is only used in a particular place. I'd suggest expanding the doc to mention where exactly this is relevant currently (
FlutterActivity), just so it's clear we don't expect it to work or be used elsewhere.