-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlutterFragment predictive back #44865
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,6 +521,7 @@ protected FlutterFragment createFlutterFragment() { | |
? TransparencyMode.opaque | ||
: TransparencyMode.transparent; | ||
final boolean shouldDelayFirstAndroidViewDraw = renderMode == RenderMode.surface; | ||
final boolean shouldAutomaticallyHandleOnBackPressed = Build.VERSION.SDK_INT >= 33; | ||
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. With this change, you'll need to update the implementation of Alternatively, you could make this condition always true and fully remove the 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 suppose removing the |
||
|
||
if (getCachedEngineId() != null) { | ||
Log.v( | ||
|
@@ -545,6 +546,7 @@ protected FlutterFragment createFlutterFragment() { | |
.shouldAttachEngineToActivity(shouldAttachEngineToActivity()) | ||
.destroyEngineWithFragment(shouldDestroyEngineWithHost()) | ||
.shouldDelayFirstAndroidViewDraw(shouldDelayFirstAndroidViewDraw) | ||
.shouldAutomaticallyHandleOnBackPressed(shouldAutomaticallyHandleOnBackPressed) | ||
.build(); | ||
} else { | ||
Log.v( | ||
|
@@ -581,6 +583,7 @@ protected FlutterFragment createFlutterFragment() { | |
.transparencyMode(transparencyMode) | ||
.shouldAttachEngineToActivity(shouldAttachEngineToActivity()) | ||
.shouldDelayFirstAndroidViewDraw(shouldDelayFirstAndroidViewDraw) | ||
.shouldAutomaticallyHandleOnBackPressed(shouldAutomaticallyHandleOnBackPressed) | ||
.build(); | ||
} | ||
|
||
|
@@ -596,6 +599,7 @@ protected FlutterFragment createFlutterFragment() { | |
.transparencyMode(transparencyMode) | ||
.shouldAttachEngineToActivity(shouldAttachEngineToActivity()) | ||
.shouldDelayFirstAndroidViewDraw(shouldDelayFirstAndroidViewDraw) | ||
.shouldAutomaticallyHandleOnBackPressed(shouldAutomaticallyHandleOnBackPressed) | ||
.build(); | ||
} | ||
} | ||
|
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 is a potentially dangerous change. Does the framework guarantee that the callback will always be enabled when applicable via
setFrameworkHandlesBack
, regardless of API version?