| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,10 +25,10 @@ import { createViewFromEntry } from "../builder"; | |||
| 25 | 25 | export * from "./frame-common"; | |
| 26 | 26 | ||
| 27 | 27 | interface AnimatorState { | |
| 28 | - enterAnimator: android.animation.Animator; | ||
| 29 | - exitAnimator: android.animation.Animator; | ||
| 30 | - popEnterAnimator: android.animation.Animator; | ||
| 31 | - popExitAnimator: android.animation.Animator; | ||
| 28 | + enterAnimator: any; | ||
| 29 | + exitAnimator: any; | ||
| 30 | + popEnterAnimator: any; | ||
| 31 | + popExitAnimator: any; | ||
| 32 | 32 | transitionName: string; | |
| 33 | 33 | } | |
| 34 | 34 | ||
@@ -306,10 +306,8 @@ export class Frame extends FrameBase { | |||
| 306 | 306 | // restore cached animation settings if we just completed simulated first navigation (no animation) | |
| 307 | 307 | if (this._cachedAnimatorState) { | |
| 308 | 308 | restoreAnimatorState(this._currentEntry, this._cachedAnimatorState); | |
| 309 | - | ||
| 310 | 309 | this._cachedAnimatorState = null; | |
| 311 | 310 | } | |
| 312 | - | ||
| 313 | 311 | } | |
| 314 | 312 | ||
| 315 | 313 | public onBackPressed(): boolean { | |
@@ -503,13 +501,26 @@ export class Frame extends FrameBase { | |||
| 503 | 501 | } | |
| 504 | 502 | } | |
| 505 | 503 | ||
| 504 | + function cloneExpandedAnimator(expandedAnimator: any) { | ||
| 505 | + if (!expandedAnimator) { | ||
| 506 | + return null; | ||
| 507 | + } | ||
| 508 | + | ||
| 509 | + const clone = expandedAnimator.clone(); | ||
| 510 | + clone.entry = expandedAnimator.entry; | ||
| 511 | + clone.transitionType = expandedAnimator.transitionType; | ||
| 512 | + | ||
| 513 | + return clone; | ||
| 514 | + } | ||
| 515 | + | ||
| 506 | 516 | function getAnimatorState(entry: BackstackEntry): AnimatorState { | |
| 507 | 517 | const expandedEntry = <any>entry; | |
| 508 | 518 | const animatorState = <AnimatorState>{}; | |
| 509 | - animatorState.enterAnimator = expandedEntry.enterAnimator; | ||
| 510 | - animatorState.exitAnimator = expandedEntry.exitAnimator; | ||
| 511 | - animatorState.popEnterAnimator = expandedEntry.popEnterAnimator; | ||
| 512 | - animatorState.popExitAnimator = expandedEntry.popExitAnimator; | ||
| 519 | + | ||
| 520 | + animatorState.enterAnimator = cloneExpandedAnimator(expandedEntry.enterAnimator); | ||
| 521 | + animatorState.exitAnimator = cloneExpandedAnimator(expandedEntry.exitAnimator); | ||
| 522 | + animatorState.popEnterAnimator = cloneExpandedAnimator(expandedEntry.popEnterAnimator); | ||
| 523 | + animatorState.popExitAnimator = cloneExpandedAnimator(expandedEntry.popExitAnimator); | ||
| 513 | 524 | animatorState.transitionName = expandedEntry.transitionName; | |
| 514 | 525 | ||
| 515 | 526 | return animatorState; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments