mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
fix(android): fragment 1.3.x issue with transitions
This commit is contained in:
@ -93,15 +93,25 @@ export function _setAndroidFragmentTransitions(animated: boolean, navigationTran
|
||||
if (name === 'none') {
|
||||
const noTransition = new NoTransition(0, null);
|
||||
|
||||
// Setup empty/immediate animator when transitioning to nested frame for first time.
|
||||
// Also setup empty/immediate transition to be executed when navigating back to this page.
|
||||
// TODO: Consider removing empty/immediate animator when migrating to official androidx.fragment.app.Fragment:1.2.
|
||||
if (isNestedDefaultTransition) {
|
||||
fragmentTransaction.setCustomAnimations(animFadeIn, animFadeOut);
|
||||
setupAllAnimation(newEntry, noTransition);
|
||||
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
|
||||
if ((<any>androidx.fragment.app.FragmentManager).enableNewStateManager) {
|
||||
// androidx.fragment 1.3.x
|
||||
if (isNestedDefaultTransition) {
|
||||
setTimeout(() => {
|
||||
addToWaitingQueue(newEntry);
|
||||
transitionOrAnimationCompleted(newEntry, null);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
|
||||
// Setup empty/immediate animator when transitioning to nested frame for first time.
|
||||
// Also setup empty/immediate transition to be executed when navigating back to this page.
|
||||
// TODO: Consider removing empty/immediate animator when migrating to official androidx.fragment.app.Fragment:1.2.
|
||||
if (isNestedDefaultTransition) {
|
||||
fragmentTransaction.setCustomAnimations(animFadeIn, animFadeOut);
|
||||
setupAllAnimation(newEntry, noTransition);
|
||||
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
|
||||
} else {
|
||||
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
|
||||
}
|
||||
}
|
||||
|
||||
newEntry.isNestedDefaultTransition = isNestedDefaultTransition;
|
||||
|
Reference in New Issue
Block a user