Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 55f02763c00ea9cf120ab7c86a526191b09c29ea
Author: jbwoods <jbwoods@google.com>
Date: Wed Mar 13 10:58:23 2019
Return proper PrimaryNavFragment after SingleTop followed by Pop
SingleTop causes a replace and a pop to be executed in the same
transaction. If the pop is processed first, the order of operations
causes the oldPrimaryNavFragment to be lost. Doing the operations in
reverse means the oldPrimaryNavFragment gets set last and is available
for the replace operation to use.
Test: ran fragment tests and tests in class
BUG: 124332597
Change-Id: If90e2dbda0a8bd3bf8ebe91579dfee205d096356
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
https://android-review.googlesource.com/928475
https://goto.google.com/android-sha1/55f02763c00ea9cf120ab7c86a526191b09c29ea
Branch: androidx-master-dev
commit 55f02763c00ea9cf120ab7c86a526191b09c29ea
Author: jbwoods <jbwoods@google.com>
Date: Wed Mar 13 10:58:23 2019
Return proper PrimaryNavFragment after SingleTop followed by Pop
SingleTop causes a replace and a pop to be executed in the same
transaction. If the pop is processed first, the order of operations
causes the oldPrimaryNavFragment to be lost. Doing the operations in
reverse means the oldPrimaryNavFragment gets set last and is available
for the replace operation to use.
Test: ran fragment tests and tests in class
BUG: 124332597
Change-Id: If90e2dbda0a8bd3bf8ebe91579dfee205d096356
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
il...@google.com <il...@google.com> #4
This is fixed internally and will be available in Fragments 1.0.0-alpha06
jb...@google.com <jb...@google.com> #5
To clarify, this is Fragments 1.1.0-alpha06
Description
Version used: 28.0.0
Given a back stack of:
A -> B (primary)
When doing a 'singleTop' style operation consisting of popping Fragment B then calling replace(), the primary navigation Fragment is correct:
A -> B2 (primary)
However, if you then proceed to call popBackStack(), the primary navigation Fragment is null, not A:
A, primary = null