mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix tslint errors
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { PercentLength, Length, Point, CustomLayoutView as CustomLayoutViewDefinition } from "ui/core/view";
|
||||
import { PercentLength, Point, CustomLayoutView as CustomLayoutViewDefinition } from "ui/core/view";
|
||||
import { ad as androidBackground } from "ui/styling/background";
|
||||
import {
|
||||
ViewCommon, layout, isEnabledProperty, originXProperty, originYProperty, automationTextProperty, isUserInteractionEnabledProperty, visibilityProperty, opacityProperty, minWidthProperty, minHeightProperty,
|
||||
@@ -6,14 +6,12 @@ import {
|
||||
marginRightProperty, marginBottomProperty, horizontalAlignmentProperty, verticalAlignmentProperty,
|
||||
rotateProperty, scaleXProperty, scaleYProperty,
|
||||
translateXProperty, translateYProperty, zIndexProperty, backgroundInternalProperty,
|
||||
Background, GestureTypes, GestureEventData, applyNativeSetters, Property,
|
||||
Background, GestureTypes, GestureEventData, applyNativeSetters,
|
||||
traceEnabled, traceWrite, traceCategories, traceNotifyEvent, Visibility, HorizontalAlignment, VerticalAlignment
|
||||
} from "./view-common";
|
||||
|
||||
export * from "./view-common";
|
||||
|
||||
let flexbox;
|
||||
|
||||
const ANDROID = "_android";
|
||||
const NATIVE_VIEW = "_nativeView";
|
||||
const VIEW_GROUP = "_viewGroup";
|
||||
@@ -65,7 +63,6 @@ const disableUserInteractionListener = new DisableUserInteractionListener();
|
||||
export class View extends ViewCommon {
|
||||
private touchListenerIsSet: boolean;
|
||||
private touchListener: android.view.View.OnTouchListener;
|
||||
private _gesturesListener: android.view.View.OnTouchListener;
|
||||
|
||||
public nativeView: android.view.View;
|
||||
|
||||
@@ -536,15 +533,15 @@ function createNativePercentLengthProperty({key, auto = 0, getPixels, setPixels,
|
||||
Object.defineProperty(View.prototype, key, {
|
||||
get: function (this: View) { return { value: getPixels(this.nativeView), unit: "px" } },
|
||||
set: function (this: View, length: PercentLength) {
|
||||
if (length == "auto") {
|
||||
if (length == "auto") { // tslint:disable-line
|
||||
setPixels(this.nativeView, auto);
|
||||
} else if (typeof length === "number") {
|
||||
setPixels(this.nativeView, length * layout.getDisplayDensity());
|
||||
} else if (length.unit == "dip") {
|
||||
} else if (length.unit == "dip") { // tslint:disable-line
|
||||
setPixels(this.nativeView, length.value * layout.getDisplayDensity());
|
||||
} else if (length.unit == "px") {
|
||||
} else if (length.unit == "px") { // tslint:disable-line
|
||||
setPixels(this.nativeView, length.value);
|
||||
} else if (length.unit == "%") {
|
||||
} else if (length.unit == "%") { // tslint:disable-line
|
||||
setPercent(this.nativeView, length.value);
|
||||
} else {
|
||||
throw new Error(`Unsupported PercentLength ${length}`);
|
||||
|
||||
Reference in New Issue
Block a user