| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f9d66de commit 7851629
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,6 +50,10 @@ const sdkVersion = lazy(() => parseInt(device.sdkVersion)); | |||
| 50 | 50 | const intEvaluator = lazy(() => new android.animation.IntEvaluator()); | |
| 51 | 51 | const defaultInterpolator = lazy(() => new android.view.animation.AccelerateDecelerateInterpolator()); | |
| 52 | 52 | ||
| 53 | + // NOTE: Android P Beta SDK version returns 27, which is API level for Android 8.1 | ||
| 54 | + // TODO: Update condition when Android P SDK version returns 28 | ||
| 55 | + const isAndroidP = lazy(() => sdkVersion() >= 27); | ||
| 56 | + | ||
| 53 | 57 | export const waitingQueue = new Map<number, Set<ExpandedEntry>>(); | |
| 54 | 58 | export const completedEntries = new Map<number, ExpandedEntry>(); | |
| 55 | 59 | ||
@@ -76,7 +80,9 @@ export function _setAndroidFragmentTransitions( | |||
| 76 | 80 | throw new Error("Calling navigation before previous navigation finish."); | |
| 77 | 81 | } | |
| 78 | 82 | ||
| 79 | - initDefaultAnimations(manager); | ||
| 83 | + if (!isAndroidP()) { | ||
| 84 | + initDefaultAnimations(manager); | ||
| 85 | + } | ||
| 80 | 86 | ||
| 81 | 87 | if (sdkVersion() >= 21) { | |
| 82 | 88 | allowTransitionOverlap(currentFragment); | |
@@ -116,7 +122,11 @@ export function _setAndroidFragmentTransitions( | |||
| 116 | 122 | if (name === "none") { | |
| 117 | 123 | transition = new NoTransition(0, null); | |
| 118 | 124 | } else if (name === "default") { | |
| 119 | - transition = new DefaultTransition(0, null); | ||
| 125 | + if (isAndroidP()) { | ||
| 126 | + transition = new FadeTransition(150, null); | ||
| 127 | + } else { | ||
| 128 | + transition = new DefaultTransition(0, null); | ||
| 129 | + } | ||
| 120 | 130 | } else if (useLollipopTransition) { | |
| 121 | 131 | // setEnterTransition: Enter | |
| 122 | 132 | // setExitTransition: Exit | |
@@ -170,7 +180,11 @@ export function _setAndroidFragmentTransitions( | |||
| 170 | 180 | } | |
| 171 | 181 | } | |
| 172 | 182 | ||
| 173 | - setupDefaultAnimations(newEntry, new DefaultTransition(0, null)); | ||
| 183 | + if (isAndroidP()) { | ||
| 184 | + setupDefaultAnimations(newEntry, new FadeTransition(150, null)); | ||
| 185 | + } else { | ||
| 186 | + setupDefaultAnimations(newEntry, new DefaultTransition(0, null)); | ||
| 187 | + } | ||
| 174 | 188 | ||
| 175 | 189 | printTransitions(currentEntry); | |
| 176 | 190 | printTransitions(newEntry); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments