diff --git a/tns-core-modules/globals/globals.ts b/tns-core-modules/globals/globals.ts index 1eed35163..7e4715852 100644 --- a/tns-core-modules/globals/globals.ts +++ b/tns-core-modules/globals/globals.ts @@ -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 ((global).android) { - const consoleModule = require("console"); - (global).console = new consoleModule.Console(); - } } } install(); diff --git a/tns-core-modules/ui/animation/animation.android.ts b/tns-core-modules/ui/animation/animation.android.ts index 0a8b76a10..549be00e9 100644 --- a/tns-core-modules/ui/animation/animation.android.ts +++ b/tns-core-modules/ui/animation/animation.android.ts @@ -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); diff --git a/tns-core-modules/ui/animation/animation.ios.ts b/tns-core-modules/ui/animation/animation.ios.ts index 6ad42057a..33b08333a 100644 --- a/tns-core-modules/ui/animation/animation.ios.ts +++ b/tns-core-modules/ui/animation/animation.ios.ts @@ -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;