Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b3af8650cc51d87063c9cd814b32144bfa48bc8b
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 11 14:17:02 2019
Implement FragmentTransaction methods in the class
Split the FragmentTransaction methods out of BackStackRecord and back
into FragmentTransaction to create a layer of separation between the
manipulation and the execution of Operations.
Moving the implementation to FragmentTransaction means new operations
can be added without the need to create empty methods in
FragmentTransactions.
Test: ran fragment tests, ./gradlew checkApi
Bug: 129780800
Change-Id: If352280983fa798eafa6aa41162e4b7d24106ecb
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
https://android-review.googlesource.com/943726
https://goto.google.com/android-sha1/b3af8650cc51d87063c9cd814b32144bfa48bc8b
Branch: androidx-master-dev
commit b3af8650cc51d87063c9cd814b32144bfa48bc8b
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 11 14:17:02 2019
Implement FragmentTransaction methods in the class
Split the FragmentTransaction methods out of BackStackRecord and back
into FragmentTransaction to create a layer of separation between the
manipulation and the execution of Operations.
Moving the implementation to FragmentTransaction means new operations
can be added without the need to create empty methods in
FragmentTransactions.
Test: ran fragment tests, ./gradlew checkApi
Bug: 129780800
Change-Id: If352280983fa798eafa6aa41162e4b7d24106ecb
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
jb...@google.com <jb...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a6c8bc7b1d821496ae8cad896566b7d334336a27
Author: jbwoods <jbwoods@google.com>
Date: Fri Apr 12 15:38:15 2019
Set max Lifecycle for a Fragment
Added FragmentTransaction API to allow Fragment Lifecycle states to be
capped at a lower Lifecycle than FragmentManager or Activity. Passing
Lifecycle.State.RESUMED effectively removes any restriction. If the
transactions are added and popped off of the FragmentManager back stack,
the max Lifecycle state returns to the previous value.
Test: new tests. Ran Fragment tests
./gradlew checkApi
BUG: 129780800
Change-Id: I20735b88ed78735894ace9ae68a1287c6235dfdc
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.kt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/BackStackState.java
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransition.java
https://android-review.googlesource.com/942528
https://goto.google.com/android-sha1/a6c8bc7b1d821496ae8cad896566b7d334336a27
Branch: androidx-master-dev
commit a6c8bc7b1d821496ae8cad896566b7d334336a27
Author: jbwoods <jbwoods@google.com>
Date: Fri Apr 12 15:38:15 2019
Set max Lifecycle for a Fragment
Added FragmentTransaction API to allow Fragment Lifecycle states to be
capped at a lower Lifecycle than FragmentManager or Activity. Passing
Lifecycle.State.RESUMED effectively removes any restriction. If the
transactions are added and popped off of the FragmentManager back stack,
the max Lifecycle state returns to the previous value.
Test: new tests. Ran Fragment tests
./gradlew checkApi
BUG: 129780800
Change-Id: I20735b88ed78735894ace9ae68a1287c6235dfdc
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.kt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/BackStackState.java
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransition.java
Description
Version used: 1.2.0-alpha02
The <fragment> tag has a number of short comings:
- It does not allow you to do FragmentTransactions on that ID later (it'll overlap after a configuration change)
- It has a slightly different lifecycle in that the Fragments aren't available until after the layout is inflated
It would be really nice if you could use FragmentContainerView and attach an android:name (and optionally an android:tag) and have it do the equivalent of an if (savedInstanceState == null) { // add the Fragment } type of code for you. This would bring together XML added Fragments and programmatically added Fragments into one system.