mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: fix tslint errors
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import * as view from 'tns-core-modules/ui/core/view';
|
||||
import {View} from 'tns-core-modules/ui/core/view';
|
||||
import * as pages from 'tns-core-modules/ui/page';
|
||||
import {Button} from 'tns-core-modules/ui/button';
|
||||
import {SegmentedBar, SegmentedBarItem} from 'tns-core-modules/ui/segmented-bar';
|
||||
import {Label} from 'tns-core-modules/ui/label';
|
||||
import {Animation, AnimationDefinition} from 'tns-core-modules/ui/animation';
|
||||
import * as fpsMeter from 'tns-core-modules/fps-meter';
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import { View } from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { SegmentedBar, SegmentedBarItem } from "tns-core-modules/ui/segmented-bar";
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { Animation, AnimationDefinition } from "tns-core-modules/ui/animation";
|
||||
import * as fpsMeter from "tns-core-modules/fps-meter";
|
||||
|
||||
let fpsCallbackId;
|
||||
export function onLoaded(args) {
|
||||
const page = args.object;
|
||||
const fpsLabel = view.getViewById(page, 'fps') as Label;
|
||||
const fpsLabel = view.getViewById(page, "fps") as Label;
|
||||
fpsCallbackId = fpsMeter.addCallback((fps: number, minFps: number) => {
|
||||
fpsLabel.text = `${fps.toFixed(2)}/${minFps.toFixed(2)}`;
|
||||
});
|
||||
@@ -30,47 +30,47 @@ export function getBoxPropertyAnimationData(property: string,
|
||||
let animateKey;
|
||||
let animateValueTo;
|
||||
let animateValueFrom;
|
||||
let animateDuration = animateEase === 'spring' ? 800 : 500;
|
||||
let animateReturnDelay = animateEase === 'spring' ? 0 : 200;
|
||||
let animateDuration = animateEase === "spring" ? 800 : 500;
|
||||
let animateReturnDelay = animateEase === "spring" ? 0 : 200;
|
||||
|
||||
// Determine the full animation property name (some are shortened in UI), and the demo to/from values
|
||||
switch (property) {
|
||||
case 'height':
|
||||
case "height":
|
||||
target.originX = target.originY = 0.5;
|
||||
animateKey = 'height';
|
||||
animateKey = "height";
|
||||
animateValueTo = 0;
|
||||
animateValueFrom = extentY;
|
||||
break;
|
||||
case 'width':
|
||||
case "width":
|
||||
target.originX = target.originY = 0.5;
|
||||
animateKey = 'width';
|
||||
animateKey = "width";
|
||||
animateValueTo = 0;
|
||||
animateValueFrom = extentX;
|
||||
break;
|
||||
case 'opacity':
|
||||
animateKey = 'opacity';
|
||||
case "opacity":
|
||||
animateKey = "opacity";
|
||||
animateValueTo = 0;
|
||||
animateValueFrom = 1;
|
||||
break;
|
||||
case 'color':
|
||||
animateKey = 'backgroundColor';
|
||||
animateValueTo = 'blue';
|
||||
animateValueFrom = 'purple';
|
||||
case "color":
|
||||
animateKey = "backgroundColor";
|
||||
animateValueTo = "blue";
|
||||
animateValueFrom = "purple";
|
||||
break;
|
||||
case 'rotate':
|
||||
case "rotate":
|
||||
target.originX = target.originY = 0.5;
|
||||
animateKey = 'rotate';
|
||||
animateKey = "rotate";
|
||||
animateValueTo = 180;
|
||||
animateValueFrom = 0;
|
||||
break;
|
||||
case 'scale':
|
||||
case "scale":
|
||||
target.originX = target.originY = 0.5;
|
||||
animateKey = 'scale';
|
||||
animateKey = "scale";
|
||||
animateValueTo = {x: 0.1, y: 0.1};
|
||||
animateValueFrom = {x: 1, y: 1};
|
||||
break;
|
||||
default:
|
||||
throw new Error(`demo animation for '${property}' is not implemented`);
|
||||
throw new Error(`demo animation for "${property}" is not implemented`);
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -86,12 +86,12 @@ export function getBoxPropertyAnimationData(property: string,
|
||||
export function easeAnimate(args) {
|
||||
const clicked = args.object as Button;
|
||||
const page: pages.Page = clicked.page;
|
||||
const select = view.getViewById(page, 'select') as SegmentedBar;
|
||||
const select = view.getViewById(page, "select") as SegmentedBar;
|
||||
const item: SegmentedBarItem = select.items[select.selectedIndex];
|
||||
const animsIn: AnimationDefinition[] = [];
|
||||
const animsOut: AnimationDefinition[] = [];
|
||||
for (let i = 0; i < 100; i++) {
|
||||
const box = view.getViewById(page, 'el-' + i) as Label;
|
||||
const box = view.getViewById(page, "el-" + i) as Label;
|
||||
const prop = getBoxPropertyAnimationData(item.title, clicked.text, box, 32, 24);
|
||||
animsIn.push({
|
||||
[prop.animateKey]: prop.animateValueTo,
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
import * as view from 'tns-core-modules/ui/core/view';
|
||||
import * as pages from 'tns-core-modules/ui/page';
|
||||
import {Button} from 'tns-core-modules/ui/button';
|
||||
import {SegmentedBar, SegmentedBarItem} from 'tns-core-modules/ui/segmented-bar';
|
||||
import {Label} from 'tns-core-modules/ui/label';
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { SegmentedBar, SegmentedBarItem } from "tns-core-modules/ui/segmented-bar";
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
|
||||
export function easeAnimate(args) {
|
||||
const clicked = args.object as Button;
|
||||
const page: pages.Page = clicked.page;
|
||||
const target = view.getViewById(page, 'target') as Label;
|
||||
const select = view.getViewById(page, 'select') as SegmentedBar;
|
||||
const target = view.getViewById(page, "target") as Label;
|
||||
const select = view.getViewById(page, "select") as SegmentedBar;
|
||||
const item: SegmentedBarItem = select.items[select.selectedIndex];
|
||||
const easeType: string = clicked.text;
|
||||
const extent = 128;
|
||||
let duration = easeType === 'spring' ? 800 : 500;
|
||||
let delay = easeType === 'spring' ? 0 : 200;
|
||||
let duration = easeType === "spring" ? 800 : 500;
|
||||
let delay = easeType === "spring" ? 0 : 200;
|
||||
let animateKey: string = null;
|
||||
let animateValueTo: any = null;
|
||||
let animateValueFrom: any = null;
|
||||
|
||||
switch (item.title) {
|
||||
case 'height':
|
||||
animateKey = 'height';
|
||||
case "height":
|
||||
animateKey = "height";
|
||||
target.originX = target.originY = 0;
|
||||
animateValueTo = 0;
|
||||
animateValueFrom = extent;
|
||||
break;
|
||||
case 'width':
|
||||
animateKey = 'width';
|
||||
case "width":
|
||||
animateKey = "width";
|
||||
target.originX = target.originY = 0;
|
||||
animateValueTo = 0;
|
||||
animateValueFrom = extent;
|
||||
break;
|
||||
case 'opacity':
|
||||
animateKey = 'opacity';
|
||||
case "opacity":
|
||||
animateKey = "opacity";
|
||||
animateValueTo = 0;
|
||||
animateValueFrom = 1;
|
||||
break;
|
||||
case 'color':
|
||||
animateKey = 'backgroundColor';
|
||||
animateValueTo = 'blue';
|
||||
animateValueFrom = 'purple';
|
||||
case "color":
|
||||
animateKey = "backgroundColor";
|
||||
animateValueTo = "blue";
|
||||
animateValueFrom = "purple";
|
||||
break;
|
||||
case 'rotate':
|
||||
animateKey = 'rotate';
|
||||
case "rotate":
|
||||
animateKey = "rotate";
|
||||
target.originX = target.originY = 0.5;
|
||||
animateValueTo = 180;
|
||||
animateValueFrom = 0;
|
||||
break;
|
||||
case 'scale':
|
||||
animateKey = 'scale';
|
||||
case "scale":
|
||||
animateKey = "scale";
|
||||
target.originX = target.originY = 0.5;
|
||||
animateValueTo = {x: 1.5, y: 1.5};
|
||||
animateValueFrom = {x: 1, y: 1};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as view from 'tns-core-modules/ui/core/view';
|
||||
import * as pages from 'tns-core-modules/ui/page';
|
||||
import * as platform from 'tns-core-modules/platform';
|
||||
import {Animation} from 'tns-core-modules/ui/animation';
|
||||
import {TextView} from 'tns-core-modules/ui/text-view';
|
||||
import {isIOS} from 'tns-core-modules/platform';
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import * as platform from "tns-core-modules/platform";
|
||||
import { Animation } from "tns-core-modules/ui/animation";
|
||||
import { TextView } from "tns-core-modules/ui/text-view";
|
||||
import { isIOS } from "tns-core-modules/platform";
|
||||
|
||||
let toggle = false;
|
||||
|
||||
@@ -15,7 +15,7 @@ export function pageLoaded(args) {
|
||||
screenHeight,
|
||||
screenYCenter,
|
||||
detailsHeight: 96,
|
||||
summary: 'Space! 🌌',
|
||||
summary: "Space! 🌌",
|
||||
ipsum: `Houston, Tranquillity Base here. The Eagle has landed.
|
||||
|
||||
For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us.
|
||||
@@ -30,7 +30,7 @@ NASA is not about the ‘Adventure of Human Space Exploration’…We won’t be
|
||||
|
||||
Science has not yet mastered prophecy. We predict too much for the next year and yet far too little for the next 10.
|
||||
|
||||
Science cuts two ways, of course; its products can be used for both good and evil. But there's no turning back from science. The early warnings about technological dangers also come from science.
|
||||
Science cuts two ways, of course; its products can be used for both good and evil. But there"s no turning back from science. The early warnings about technological dangers also come from science.
|
||||
|
||||
Here men from the planet Earth first set foot upon the Moon. July 1969 AD. We came in peace for all mankind.
|
||||
|
||||
@@ -43,13 +43,13 @@ http://spaceipsum.com`
|
||||
export function theFinalFrontier(args) {
|
||||
const clicked = args.object as view.View;
|
||||
const page: pages.Page = clicked.page;
|
||||
const details = view.getViewById(page, 'details') as TextView;
|
||||
const details = view.getViewById(page, "details") as TextView;
|
||||
const ctx = page.bindingContext;
|
||||
const detailHeaderHeight: number = ctx.detailsHeight;
|
||||
|
||||
let statusBar = 0;
|
||||
if(isIOS) {
|
||||
const {ios} = require('tns-core-modules/ui/utils');
|
||||
if (isIOS) {
|
||||
const {ios} = require("tns-core-modules/ui/utils");
|
||||
statusBar = ios.getStatusBarHeight();
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ export function theFinalFrontier(args) {
|
||||
const transitions = [
|
||||
{
|
||||
target: clicked,
|
||||
height: toggle ? '100%' : detailHeaderHeight,
|
||||
height: toggle ? "100%" : detailHeaderHeight,
|
||||
duration: 200,
|
||||
curve: 'ease'
|
||||
curve: "ease"
|
||||
},
|
||||
{
|
||||
target: details,
|
||||
@@ -70,7 +70,7 @@ export function theFinalFrontier(args) {
|
||||
y: toggle ? 50 : 0,
|
||||
},
|
||||
duration: 200,
|
||||
curve: 'easeIn'
|
||||
curve: "easeIn"
|
||||
}
|
||||
];
|
||||
const animationSet = new Animation(transitions, false);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Label} from 'tns-core-modules/ui/label';
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
|
||||
let toggle = false;
|
||||
|
||||
@@ -6,9 +6,9 @@ export function animateHeight(args) {
|
||||
const clicked = args.object as Label;
|
||||
clicked
|
||||
.animate({
|
||||
height: toggle ? 128 : '100%',
|
||||
height: toggle ? 128 : "100%",
|
||||
duration: 200,
|
||||
curve: 'easeInOut'
|
||||
curve: "easeInOut"
|
||||
})
|
||||
.then(() => {
|
||||
clicked.text = toggle ? "Cool." : "Tap here";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as view from 'tns-core-modules/ui/core/view';
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
|
||||
export function tapLabel(args) {
|
||||
const clicked: view.View = args.object;
|
||||
@@ -6,7 +6,7 @@ export function tapLabel(args) {
|
||||
clicked.animate({
|
||||
height: graffiti.toggle ? 64 : 128,
|
||||
duration: 200,
|
||||
curve: 'easeOut'
|
||||
curve: "easeOut"
|
||||
});
|
||||
graffiti.toggle = !graffiti.toggle;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AnimationPromise } from "tns-core-modules/ui/animation";
|
||||
|
||||
// >> animation-require
|
||||
import * as animation from "tns-core-modules/ui/animation";
|
||||
import {PercentLength} from "tns-core-modules/ui/styling/style-properties";
|
||||
import { PercentLength } from "tns-core-modules/ui/styling/style-properties";
|
||||
// << animation-require
|
||||
|
||||
function prepareTest(parentHeight?: number, parentWidth?: number): Label {
|
||||
@@ -20,10 +20,10 @@ function prepareTest(parentHeight?: number, parentWidth?: number): Label {
|
||||
let stackLayout = new StackLayout();
|
||||
// optionally size the parent extent to make assertions about percentage values
|
||||
if (parentHeight !== undefined) {
|
||||
stackLayout.height = PercentLength.parse(parentHeight + '');
|
||||
stackLayout.height = PercentLength.parse(parentHeight + "");
|
||||
}
|
||||
if (parentWidth !== undefined) {
|
||||
stackLayout.width = PercentLength.parse(parentWidth + '');
|
||||
stackLayout.width = PercentLength.parse(parentWidth + "");
|
||||
}
|
||||
stackLayout.addChild(label);
|
||||
mainPage.content = stackLayout;
|
||||
@@ -403,13 +403,13 @@ export function test_AnimateRotate(done) {
|
||||
});
|
||||
}
|
||||
|
||||
function animateExtentAndAssertExpected(along: 'height' | 'width', value: PercentLength, pixelExpected: PercentLength): Promise<void> {
|
||||
function animateExtentAndAssertExpected(along: "height" | "width", value: PercentLength, pixelExpected: PercentLength): Promise<void> {
|
||||
function pretty(val) {
|
||||
return JSON.stringify(val, null, 2);
|
||||
}
|
||||
const parentExtent = 200;
|
||||
const height = along === 'height' ? parentExtent : undefined;
|
||||
const width = along === 'height' ? undefined : parentExtent;
|
||||
const height = along === "height" ? parentExtent : undefined;
|
||||
const width = along === "height" ? undefined : parentExtent;
|
||||
const label = prepareTest(height, width);
|
||||
const props = {
|
||||
duration: 5,
|
||||
@@ -421,15 +421,15 @@ function animateExtentAndAssertExpected(along: 'height' | 'width', value: Percen
|
||||
TKUnit.assertEqual(
|
||||
observedString,
|
||||
inputString,
|
||||
`PercentLength.convertToString(${pretty(value)}) should be '${inputString}' but is '${observedString}'`
|
||||
`PercentLength.convertToString(${pretty(value)}) should be "${inputString}" but is "${observedString}"`
|
||||
);
|
||||
// assert that the animated view's calculated pixel extent matches the expected pixel value
|
||||
// assert that the animated view"s calculated pixel extent matches the expected pixel value
|
||||
const observedNumber: number = PercentLength.toDevicePixels(label[along], parentExtent, parentExtent);
|
||||
const expectedNumber: number = PercentLength.toDevicePixels(pixelExpected, parentExtent, parentExtent);
|
||||
TKUnit.assertEqual(
|
||||
observedNumber,
|
||||
expectedNumber,
|
||||
`PercentLength.toDevicePixels(${inputString}) should be '${expectedNumber}' but is '${observedNumber}'`
|
||||
`PercentLength.toDevicePixels(${inputString}) should be "${expectedNumber}" but is "${observedNumber}"`
|
||||
);
|
||||
assertIOSNativeTransformIsCorrect(label);
|
||||
});
|
||||
@@ -438,21 +438,21 @@ function animateExtentAndAssertExpected(along: 'height' | 'width', value: Percen
|
||||
export function test_AnimateExtent_Should_ResolvePercentageStrings(done) {
|
||||
let promise: Promise<any> = Promise.resolve();
|
||||
const pairs: [string, string][] = [
|
||||
['100%', '200px'],
|
||||
['50%', '100px'],
|
||||
['25%', '50px'],
|
||||
['-25%', '-50px'],
|
||||
['-50%', '-100px'],
|
||||
['-100%', '-200px'],
|
||||
["100%", "200px"],
|
||||
["50%", "100px"],
|
||||
["25%", "50px"],
|
||||
["-25%", "-50px"],
|
||||
["-50%", "-100px"],
|
||||
["-100%", "-200px"],
|
||||
];
|
||||
pairs.forEach((pair) => {
|
||||
const input = PercentLength.parse(pair[0]);
|
||||
const expected = PercentLength.parse(pair[1]);
|
||||
promise = promise.then(() => {
|
||||
return animateExtentAndAssertExpected('height', input, expected);
|
||||
return animateExtentAndAssertExpected("height", input, expected);
|
||||
});
|
||||
promise = promise.then(() => {
|
||||
return animateExtentAndAssertExpected('width', input, expected);
|
||||
return animateExtentAndAssertExpected("width", input, expected);
|
||||
});
|
||||
});
|
||||
promise.then(() => done()).catch(done);
|
||||
@@ -461,20 +461,20 @@ export function test_AnimateExtent_Should_ResolvePercentageStrings(done) {
|
||||
export function test_AnimateExtent_Should_AcceptStringPixelValues(done) {
|
||||
let promise: Promise<any> = Promise.resolve();
|
||||
const pairs: [string, number][] = [
|
||||
['100px', 100],
|
||||
['50px', 50]
|
||||
["100px", 100],
|
||||
["50px", 50]
|
||||
];
|
||||
pairs.forEach((pair) => {
|
||||
const input = PercentLength.parse(pair[0]);
|
||||
const expected = {
|
||||
unit: 'px',
|
||||
unit: "px",
|
||||
value: pair[1]
|
||||
} as PercentLength;
|
||||
promise = promise.then(() => {
|
||||
return animateExtentAndAssertExpected('height', input, expected);
|
||||
return animateExtentAndAssertExpected("height", input, expected);
|
||||
});
|
||||
promise = promise.then(() => {
|
||||
return animateExtentAndAssertExpected('width', input, expected);
|
||||
return animateExtentAndAssertExpected("width", input, expected);
|
||||
});
|
||||
});
|
||||
promise.then(() => done()).catch(done);
|
||||
@@ -486,10 +486,10 @@ export function test_AnimateExtent_Should_AcceptNumberValuesAsDip(done) {
|
||||
inputs.forEach((value) => {
|
||||
const parsed = PercentLength.parse(value);
|
||||
promise = promise.then(() => {
|
||||
return animateExtentAndAssertExpected('height', parsed, parsed);
|
||||
return animateExtentAndAssertExpected("height", parsed, parsed);
|
||||
});
|
||||
promise = promise.then(() => {
|
||||
return animateExtentAndAssertExpected('width', parsed, parsed);
|
||||
return animateExtentAndAssertExpected("width", parsed, parsed);
|
||||
});
|
||||
});
|
||||
promise.then(() => done()).catch(done);
|
||||
@@ -499,10 +499,10 @@ export function test_AnimateExtent_Should_ThrowIfCannotParsePercentLength() {
|
||||
const label = new Label();
|
||||
helper.buildUIAndRunTest(label, (views: Array<viewModule.View>) => {
|
||||
TKUnit.assertThrows(() => {
|
||||
label.animate({width: '-frog%'});
|
||||
label.animate({width: "-frog%"});
|
||||
}, "Invalid percent string should throw");
|
||||
TKUnit.assertThrows(() => {
|
||||
label.animate({height: '-frog%'});
|
||||
label.animate({height: "-frog%"});
|
||||
}, "Invalid percent string should throw");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -878,26 +878,26 @@ function assertPercentLengthParseInputOutputPairs(pairs: [string, any][]) {
|
||||
|
||||
export function test_PercentLength_parses_pixel_values_from_string_input() {
|
||||
assertPercentLengthParseInputOutputPairs([
|
||||
['4px', {unit: 'px', value: 4}],
|
||||
['-4px', {unit: 'px', value: -4}],
|
||||
["4px", {unit: "px", value: 4}],
|
||||
["-4px", {unit: "px", value: -4}],
|
||||
]);
|
||||
}
|
||||
|
||||
export function test_PercentLength_parses_percentage_values_from_string_input() {
|
||||
assertPercentLengthParseInputOutputPairs([
|
||||
['4%', {unit: '%', value: 0.04}],
|
||||
['17%', {unit: '%', value: 0.17}],
|
||||
['-27%', {unit: '%', value: -0.27}],
|
||||
["4%", {unit: "%", value: 0.04}],
|
||||
["17%", {unit: "%", value: 0.17}],
|
||||
["-27%", {unit: "%", value: -0.27}],
|
||||
]);
|
||||
}
|
||||
|
||||
export function test_PercentLength_parse_throws_given_string_input_it_cannot_parse() {
|
||||
const inputs: any[] = [
|
||||
'-l??%',
|
||||
'qre%',
|
||||
'undefinedpx',
|
||||
'undefined',
|
||||
'-frog%'
|
||||
"-l??%",
|
||||
"qre%",
|
||||
"undefinedpx",
|
||||
"undefined",
|
||||
"-frog%"
|
||||
];
|
||||
inputs.forEach((input) => {
|
||||
TKUnit.assertThrows(() => {
|
||||
|
||||
@@ -270,7 +270,7 @@ export abstract class AnimationBase implements AnimationBaseDefinition {
|
||||
}
|
||||
|
||||
if (propertyAnimations.length === 0) {
|
||||
throw new Error('No known animation properties specified');
|
||||
throw new Error("No known animation properties specified");
|
||||
}
|
||||
|
||||
return propertyAnimations;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { layout } from "../../utils/utils";
|
||||
import { device } from "../../platform";
|
||||
import lazy from "../../utils/lazy";
|
||||
import * as platform from '../../platform';
|
||||
import * as platform from "../../platform";
|
||||
export * from "./animation-common";
|
||||
|
||||
interface AnimationDefinitionInternal extends AnimationDefinition {
|
||||
@@ -456,7 +456,7 @@ export class Animation extends AnimationBase {
|
||||
case Properties.width:
|
||||
case Properties.height: {
|
||||
|
||||
const isVertical: boolean = propertyAnimation.property === 'height';
|
||||
const isVertical: boolean = propertyAnimation.property === "height";
|
||||
const extentProperty = isVertical ? heightProperty : widthProperty;
|
||||
|
||||
extentProperty._initDefaultNativeValue(style);
|
||||
|
||||
2
tns-core-modules/ui/animation/animation.d.ts
vendored
2
tns-core-modules/ui/animation/animation.d.ts
vendored
@@ -3,7 +3,7 @@
|
||||
*/ /** */
|
||||
|
||||
import { View, Color } from "../core/view";
|
||||
import {PercentLength} from '../styling/style-properties';
|
||||
import { PercentLength } from "../styling/style-properties";
|
||||
|
||||
/**
|
||||
* Defines animation options for the View.animate method.
|
||||
|
||||
@@ -362,7 +362,7 @@ export class Animation extends AnimationBase {
|
||||
case Properties.width:
|
||||
case Properties.height:
|
||||
const direction: string = animation.property;
|
||||
const isHeight: boolean = direction === 'height';
|
||||
const isHeight: boolean = direction === "height";
|
||||
propertyNameToAnimate = "bounds";
|
||||
if (!parent) {
|
||||
throw new Error(`cannot animate ${direction} on root view`);
|
||||
|
||||
Reference in New Issue
Block a user