mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: refactor
This commit is contained in:
@@ -184,15 +184,6 @@ export function install() {
|
||||
registerOnGlobalContext("Headers", "fetch");
|
||||
registerOnGlobalContext("Request", "fetch");
|
||||
registerOnGlobalContext("Response", "fetch");
|
||||
|
||||
// check whether the 'android' namespace is exposed
|
||||
// if positive - the current device is an Android
|
||||
// so a custom implementation of the global 'console' object is attached.
|
||||
// otherwise do nothing on iOS - the NS runtime provides a native 'console' functionality.
|
||||
if ((<any>global).android) {
|
||||
const consoleModule = require("console");
|
||||
(<any>global).console = new consoleModule.Console();
|
||||
}
|
||||
}
|
||||
}
|
||||
install();
|
||||
|
||||
@@ -10,9 +10,8 @@ import {
|
||||
} from "../styling/style-properties";
|
||||
|
||||
import { layout } from "../../utils/utils";
|
||||
import { device } from "../../platform";
|
||||
import { device, screen } from "../../platform";
|
||||
import lazy from "../../utils/lazy";
|
||||
import * as platform from "../../platform";
|
||||
export * from "./animation-common";
|
||||
|
||||
interface AnimationDefinitionInternal extends AnimationDefinition {
|
||||
@@ -467,10 +466,10 @@ export class Animation extends AnimationBase {
|
||||
throw new Error(`cannot animate ${propertyAnimation.property} on root view`);
|
||||
}
|
||||
const parentExtent: number = isVertical ? parent.getMeasuredHeight() : parent.getMeasuredWidth();
|
||||
toValue = PercentLength.toDevicePixels(toValue, parentExtent, parentExtent) / platform.screen.mainScreen.scale;
|
||||
toValue = PercentLength.toDevicePixels(toValue, parentExtent, parentExtent) / screen.mainScreen.scale;
|
||||
const nativeHeight: number = isVertical ? nativeView.getHeight() : nativeView.getWidth();
|
||||
const targetStyle: string = setLocal ? extentProperty.name : extentProperty.keyframe;
|
||||
originalValue1 = nativeHeight / platform.screen.mainScreen.scale;
|
||||
originalValue1 = nativeHeight / screen.mainScreen.scale;
|
||||
nativeArray[0] = originalValue1;
|
||||
nativeArray[1] = toValue;
|
||||
let extentAnimator = android.animation.ValueAnimator.ofFloat(nativeArray);
|
||||
|
||||
@@ -8,8 +8,7 @@ import {
|
||||
heightProperty, widthProperty, PercentLength
|
||||
} from "../styling/style-properties";
|
||||
|
||||
import { ios } from "../../utils/utils";
|
||||
import * as platform from "../../platform";
|
||||
import { screen } from "../../platform";
|
||||
|
||||
export * from "./animation-common";
|
||||
|
||||
@@ -276,7 +275,7 @@ export class Animation extends AnimationBase {
|
||||
let toValue = animation.value;
|
||||
let fromValue;
|
||||
const parent = animation.target.parent as View;
|
||||
const screenScale: number = platform.screen.mainScreen.scale;
|
||||
const screenScale: number = screen.mainScreen.scale;
|
||||
|
||||
let tempRotate = (animation.target.rotate || 0) * Math.PI / 180;
|
||||
let abs;
|
||||
|
||||
Reference in New Issue
Block a user