Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Would an overload of postponeEnterTransition that takes a timeout be more useful for this particular case?
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e63385919b429dcfb633a47598a3fdab66d6cd7a
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 11 09:30:40 2019
Add postponeEnterTransition overload with a timeout
This gives users the option to set a delay for
startPostponedEnterTransition() to be called after
postponeEnterTransition instead of the need to call it manually.
Test: Added tests ./gradlew checkApi
BUG: 120803208
Change-Id: If17fe65fa450daff47321552582fb558c412c9b1
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/PostponedTransitionTest.kt
M fragment/src/main/java/androidx/fragment/app/Fragment.java
https://android-review.googlesource.com/948724
https://goto.google.com/android-sha1/e63385919b429dcfb633a47598a3fdab66d6cd7a
Branch: androidx-master-dev
commit e63385919b429dcfb633a47598a3fdab66d6cd7a
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 11 09:30:40 2019
Add postponeEnterTransition overload with a timeout
This gives users the option to set a delay for
startPostponedEnterTransition() to be called after
postponeEnterTransition instead of the need to call it manually.
Test: Added tests ./gradlew checkApi
BUG: 120803208
Change-Id: If17fe65fa450daff47321552582fb558c412c9b1
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/PostponedTransitionTest.kt
M fragment/src/main/java/androidx/fragment/app/Fragment.java
il...@google.com <il...@google.com> #4
We've decided to add an optional timeout argument to postponeEnterTransition() which handle this use case.
Description
Version used: 1.1.0-alpha02
We have postponeEnterTransition() to mark that a fragment transition should be postponed, but you usually have to do something like the following to ensure that we don't sit there postponed forever:
var postponed = false
override fun postponeEnterTransition() {
super.postponeEnterTransition()
postponed = true
}
override fun onStart() {
super.onStart()
if (postponed && !startedTransition) {
// We're postponed and haven't started a transition yet, we'll delay for a max of 2000ms
view?.postDelayed(::scheduleStartPostponedTransitions, 2000)
}
}
It would be nice if isPostponed() was made public rather than relying on my flag.