mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Inital animations were not played in android, since CSS in android is now applied before the native view is created/assigned
This commit is contained in:
@@ -86,6 +86,8 @@ if (application.hasLaunched()) {
|
||||
}
|
||||
|
||||
export class CssState {
|
||||
private _pendingKeyframeAnimations: SelectorCore[];
|
||||
|
||||
constructor(private view: ViewBase, private match: SelectorsMatch<ViewBase>) {
|
||||
}
|
||||
|
||||
@@ -103,7 +105,15 @@ export class CssState {
|
||||
}
|
||||
|
||||
matchingSelectors.forEach(s => this.applyDescriptors(s.ruleset));
|
||||
matchingSelectors.forEach(s => this.playKeyframeAnimations(s.ruleset));
|
||||
this._pendingKeyframeAnimations = matchingSelectors;
|
||||
this.playPendingKeyframeAnimations();
|
||||
}
|
||||
|
||||
public playPendingKeyframeAnimations() {
|
||||
if (this._pendingKeyframeAnimations && this.view.nativeView) {
|
||||
this._pendingKeyframeAnimations.forEach(s => this.playKeyframeAnimationsFromRuleSet(s.ruleset));
|
||||
this._pendingKeyframeAnimations = null;
|
||||
}
|
||||
}
|
||||
|
||||
private applyDescriptors(ruleset: RuleSet): void {
|
||||
@@ -123,7 +133,7 @@ export class CssState {
|
||||
});
|
||||
}
|
||||
|
||||
private playKeyframeAnimations(ruleset: RuleSet): void {
|
||||
private playKeyframeAnimationsFromRuleSet(ruleset: RuleSet): void {
|
||||
let ruleAnimations: kam.KeyframeAnimationInfo[] = ruleset[animationsSymbol];
|
||||
if (ruleAnimations) {
|
||||
ensureKeyframeAnimationModule();
|
||||
|
||||
Reference in New Issue
Block a user