Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into flutter-fragment-predictive-back
  • Loading branch information
justinmc committed May 28, 2024
commit 48765ee16c46679552e921fca8cd2be9118a3209
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void itDelegatesOnBackPressedWithSetFrameworkHandlesBack() {

// Calling onBackPressed now will still be handled by Android (the default),
Copy link
Contributor

Choose a reason for hiding this comment

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

reading this test shouldn't the back pressed be handled by the framework because of the code on 306?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My comment above should help explain this a bit. shouldAutomaticallyHandleOnBackPressed enables predictive back, while setFrameworkHandlesBack determines whether Android or the framework handle the back gesture.

// until setFrameworkHandlesBack is set to true.
activity.onBackPressed();
activity.getOnBackPressedDispatcher().onBackPressed();
verify(mockDelegate, times(0)).onBackPressed();

// Setting setFrameworkHandlesBack to true means the delegate will receive
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.