mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +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') {
|
if (name === 'none') {
|
||||||
const noTransition = new NoTransition(0, null);
|
const noTransition = new NoTransition(0, null);
|
||||||
|
|
||||||
// Setup empty/immediate animator when transitioning to nested frame for first time.
|
if ((<any>androidx.fragment.app.FragmentManager).enableNewStateManager) {
|
||||||
// Also setup empty/immediate transition to be executed when navigating back to this page.
|
// androidx.fragment 1.3.x
|
||||||
// TODO: Consider removing empty/immediate animator when migrating to official androidx.fragment.app.Fragment:1.2.
|
if (isNestedDefaultTransition) {
|
||||||
if (isNestedDefaultTransition) {
|
setTimeout(() => {
|
||||||
fragmentTransaction.setCustomAnimations(animFadeIn, animFadeOut);
|
addToWaitingQueue(newEntry);
|
||||||
setupAllAnimation(newEntry, noTransition);
|
transitionOrAnimationCompleted(newEntry, null);
|
||||||
setupNewFragmentCustomTransition({ duration: 0, curve: null }, newEntry, noTransition);
|
});
|
||||||
|
}
|
||||||
} else {
|
} 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;
|
newEntry.isNestedDefaultTransition = isNestedDefaultTransition;
|
||||||
|
Reference in New Issue
Block a user