Trying to fix the Travis build.

This commit is contained in:
Rossen Hristov
2016-06-02 15:18:23 +03:00
parent 8ba9ec3855
commit 17cc067e25

View File

@ -376,18 +376,20 @@ export class Animation extends common.Animation implements definition.Animation
private _enableHardwareAcceleration() { private _enableHardwareAcceleration() {
for (let i = 0, length = this._propertyAnimations.length; i < length; i++) { for (let i = 0, length = this._propertyAnimations.length; i < length; i++) {
let cache = <CacheLayerType>this._propertyAnimations[i].target._nativeView; let cache = <CacheLayerType>this._propertyAnimations[i].target._nativeView;
let layerType = cache.getLayerType(); if (cache){
if (layerType !== android.view.View.LAYER_TYPE_HARDWARE) { let layerType = cache.getLayerType();
cache.layerType = layerType; if (layerType !== android.view.View.LAYER_TYPE_HARDWARE) {
cache.setLayerType(android.view.View.LAYER_TYPE_HARDWARE, null); cache.layerType = layerType;
} cache.setLayerType(android.view.View.LAYER_TYPE_HARDWARE, null);
}
}
} }
} }
private _disableHardwareAcceleration() { private _disableHardwareAcceleration() {
for (let i = 0, length = this._propertyAnimations.length; i < length; i++) { for (let i = 0, length = this._propertyAnimations.length; i < length; i++) {
let cache = <CacheLayerType>this._propertyAnimations[i].target._nativeView; let cache = <CacheLayerType>this._propertyAnimations[i].target._nativeView;
if (cache.layerType !== undefined) { if (cache && cache.layerType !== undefined) {
cache.setLayerType(cache.layerType, null); cache.setLayerType(cache.layerType, null);
cache.layerType = undefined; cache.layerType = undefined;
} }