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:
Panayot Cankov
2017-04-11 16:49:14 +03:00
parent 4069bcea02
commit 108f4c287d
2 changed files with 19 additions and 3 deletions

View File

@@ -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();