Fix foldable window transitions after notification and floating opens#1946
Open
rybnikov wants to merge 5 commits intoDrKLO:masterfrom
Open
Fix foldable window transitions after notification and floating opens#1946rybnikov wants to merge 5 commits intoDrKLO:masterfrom
rybnikov wants to merge 5 commits intoDrKLO:masterfrom
Conversation
edc53af to
65aa2ff
Compare
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.
This fixes four regressions that show up on foldables and in Android split-screen.
The first issue was tablet detection after resume. On foldables,
checkDisplaySize(activity, ...)refresheddisplaySizeanddensityfrom the current activity, butresetTabletFlag()then repopulated the tablet cache throughisTabletForce(), which was still reading stale application-context metrics. That could leave the app cached in phone mode on an unfolded screen after wake or resume. The fix makesisTabletForce()use the already refresheddisplaySizeanddensityfirst, with the application-context metrics kept only as an early-init fallback.The second issue was navigation recovery after window transitions. The existing safety reset in
ActionBarLayoutwas firing even while a fresh animation was still valid, which could interrupt normal transitions. The fix keeps the reset path for genuinely stuck state, but skips it for fresh transitions and logs when end callbacks have to be dropped.The third issue was chat back navigation after resizing split-screen. During layout migration,
LaunchActivitymoved an existingChatActivitybetween layouts by destroying and re-adding the same fragment instance. That left the fragment in a finished state, so the chat back button stopped working after a resize. The fix resets the fragment before re-adding it, and also avoids routing back presses into the right pane when the activity is already in full-size mode.The fourth issue was foldable window recovery after notification and floating-window opens. The existing changes in this PR keep the tablet layout and fragment state coherent when the window mode changes under the activity.