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:
@@ -9,8 +9,6 @@ import * as traceModule from "trace";
|
||||
import * as utilsModule from "utils/utils";
|
||||
import * as imageSourceModule from "image-source";
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
|
||||
const R_ID_HOME = 0x0102002c;
|
||||
const ACTION_ITEM_ID_OFFSET = 1000;
|
||||
|
||||
@@ -7,8 +7,6 @@ import view = require("ui/core/view");
|
||||
import utils = require("utils/utils");
|
||||
import types = require("utils/types");
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import frame = require("ui/frame");
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import enums = require("ui/enums");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
@@ -76,4 +75,4 @@ export class ActivityIndicatorStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
ActivityIndicatorStyler.registerHandlers();
|
||||
ActivityIndicatorStyler.registerHandlers();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import aiCommon = require("./activity-indicator-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
@@ -60,4 +59,4 @@ export class ActivityIndicatorStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
ActivityIndicatorStyler.registerHandlers();
|
||||
ActivityIndicatorStyler.registerHandlers();
|
||||
|
||||
@@ -38,8 +38,6 @@ class AnimationDelegateImpl extends NSObject {
|
||||
}
|
||||
|
||||
animationDidStart(anim: CAAnimation): void {
|
||||
var nativeView = <UIView>this._propertyAnimation.target._nativeView;
|
||||
var propertyNameToAnimate = this._propertyAnimation.property;
|
||||
var value = this._propertyAnimation.value;
|
||||
|
||||
(<any>this._propertyAnimation.target)._suspendPresentationLayerUpdates();
|
||||
@@ -409,7 +407,6 @@ export class Animation extends common.Animation implements definition.Animation
|
||||
|
||||
private static _createNativeAffineTransform(animation: common.PropertyAnimation): CATransform3D {
|
||||
var value = animation.value;
|
||||
var nativeView = <UIView>animation.target._nativeView;
|
||||
var result:CATransform3D = CATransform3DIdentity;
|
||||
|
||||
if (value[common.Properties.translate] !== undefined) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import stateChanged = require("ui/core/control-state-change");
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import view = require("ui/core/view");
|
||||
import utils = require("utils/utils");
|
||||
import enums = require("ui/enums");
|
||||
|
||||
@@ -7,7 +7,6 @@ import proxy = require("ui/core/proxy");
|
||||
import gestures = require("ui/gestures");
|
||||
import * as types from "utils/types";
|
||||
import style = require("ui/styling/style");
|
||||
import styling = require("ui/styling");
|
||||
import enums = require("ui/enums");
|
||||
import background = require("ui/styling/background");
|
||||
import {CommonLayoutParams, Thickness} from "ui/styling/style";
|
||||
@@ -17,7 +16,6 @@ global.moduleMerge(viewCommon, exports);
|
||||
var ANDROID = "_android";
|
||||
var NATIVE_VIEW = "_nativeView";
|
||||
var VIEW_GROUP = "_viewGroup";
|
||||
var OWNER = "_owner";
|
||||
|
||||
function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
var view = <View>data.object;
|
||||
|
||||
@@ -5,7 +5,6 @@ import utils = require("utils/utils");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import style = require("ui/styling/style");
|
||||
import styling = require("ui/styling");
|
||||
import enums = require("ui/enums");
|
||||
import * as backgroundModule from "ui/styling/background";
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import common = require("./date-picker-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
@@ -144,4 +143,4 @@ export class DatePickerStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
DatePickerStyler.registerHandlers();
|
||||
DatePickerStyler.registerHandlers();
|
||||
|
||||
@@ -12,7 +12,6 @@ import transitionModule = require("ui/transition");
|
||||
global.moduleMerge(frameCommon, exports);
|
||||
|
||||
var TAG = "_fragmentTag";
|
||||
var OWNER = "_owner";
|
||||
var HIDDEN = "_hidden";
|
||||
var INTENT_EXTRA = "com.tns.activity";
|
||||
var ROOT_VIEW = "_rootView";
|
||||
@@ -806,4 +805,4 @@ function getFrameById(frameId: number): Frame {
|
||||
|
||||
export function getActivity(): Object {
|
||||
return NativeActivity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import utils = require("utils/utils");
|
||||
import view = require("ui/core/view");
|
||||
import uiUtils = require("ui/utils");
|
||||
import * as types from "utils/types";
|
||||
import * as animationModule from "ui/animation";
|
||||
import * as transitionModule from "ui/transition";
|
||||
import application = require("application");
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import observable = require("data/observable");
|
||||
import view = require("ui/core/view");
|
||||
import trace = require("trace");
|
||||
import utils = require("utils/utils");
|
||||
import types = require("utils/types");
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@@ -427,9 +426,6 @@ class CustomPanGestureDetector {
|
||||
}
|
||||
|
||||
public onTouchEvent(event: android.view.MotionEvent) {
|
||||
let pointerID = event.getPointerId(event.getActionIndex());
|
||||
let wasTracking = this.isTracking;
|
||||
|
||||
switch (event.getActionMasked()) {
|
||||
case android.view.MotionEvent.ACTION_UP:
|
||||
case android.view.MotionEvent.ACTION_CANCEL:
|
||||
@@ -712,4 +708,4 @@ class TouchGestureEventData implements definition.TouchGestureEventData {
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import * as enumsModule from "ui/enums";
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import view = require("ui/core/view");
|
||||
import background = require("ui/styling/background");
|
||||
import utils = require("utils/utils");
|
||||
|
||||
@@ -5,7 +5,6 @@ import * as utils from "utils/utils";
|
||||
import * as backgroundModule from "ui/styling/background";
|
||||
import view = require("ui/core/view");
|
||||
import style = require("ui/styling/style");
|
||||
import styling = require("ui/styling");
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import utils = require("utils/utils");
|
||||
import common = require("./grid-layout-common");
|
||||
import {View} from "ui/core/view";
|
||||
import {CommonLayoutParams} from "ui/styling/style";
|
||||
import {HorizontalAlignment, VerticalAlignment} from "ui/enums";
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
@@ -979,4 +978,4 @@ class MeasureHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,6 @@ export class LayoutBase extends view.CustomLayoutView implements definition.Layo
|
||||
}
|
||||
|
||||
public eachLayoutChild(callback: (child: view.View, isLast: boolean) => void): void {
|
||||
var index = 0;
|
||||
var lastChild: view.View = null;
|
||||
|
||||
this._eachChildView((cv) => {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import definition = require("ui/layouts/stack-layout");
|
||||
import platform = require("platform");
|
||||
import {LayoutBase} from "ui/layouts/layout-base";
|
||||
import {View} from "ui/core/view";
|
||||
import {Orientation} from "ui/enums";
|
||||
import {PropertyMetadata} from "ui/core/proxy";
|
||||
import {Property, PropertyMetadataSettings} from "ui/core/dependency-observable";
|
||||
@@ -22,4 +21,4 @@ export class StackLayout extends LayoutBase implements definition.StackLayout {
|
||||
set orientation(value: string) {
|
||||
this._setValue(StackLayout.orientationProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import definition = require("ui/layouts/wrap-layout");
|
||||
import platform = require("platform");
|
||||
import {LayoutBase} from "ui/layouts/layout-base";
|
||||
import {View} from "ui/core/view";
|
||||
import {Orientation} from "ui/enums";
|
||||
import {PropertyMetadata} from "ui/core/proxy";
|
||||
import {Property, PropertyMetadataSettings} from "ui/core/dependency-observable";
|
||||
@@ -42,4 +41,4 @@ export class WrapLayout extends LayoutBase implements definition.WrapLayout {
|
||||
set itemHeight(value: number) {
|
||||
this._setValue(WrapLayout.itemHeightProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import view = require("ui/core/view");
|
||||
import dts = require("ui/page");
|
||||
import styleScope = require("../styling/style-scope");
|
||||
import {ActionBar} from "ui/action-bar";
|
||||
import {DependencyObservable, PropertyMetadata, PropertyMetadataSettings, PropertyChangeData, Property, ValueSource} from "ui/core/dependency-observable";
|
||||
import {PropertyMetadataSettings, PropertyChangeData, Property, ValueSource} from "ui/core/dependency-observable";
|
||||
import * as style from "../styling/style";
|
||||
import * as fileSystemModule from "file-system";
|
||||
import * as frameModule from "ui/frame";
|
||||
|
||||
@@ -6,7 +6,6 @@ import uiUtils = require("ui/utils");
|
||||
import utils = require("utils/utils");
|
||||
import {device} from "platform";
|
||||
import {DeviceType} from "ui/enums";
|
||||
import observable = require("data/observable");
|
||||
|
||||
global.moduleMerge(pageCommon, exports);
|
||||
|
||||
@@ -36,7 +35,6 @@ class UIViewControllerImpl extends UIViewController {
|
||||
let isTablet = device.deviceType === DeviceType.Tablet;
|
||||
let isFullScreen = !owner._UIModalPresentationFormSheet || !isTablet;
|
||||
let frame = isFullScreen ? UIScreen.mainScreen().bounds : this.view.frame;
|
||||
let origin = frame.origin;
|
||||
let size = frame.size;
|
||||
let width = size.width;
|
||||
let height = size.height;
|
||||
@@ -318,4 +316,4 @@ export class Page extends pageCommon.Page {
|
||||
|
||||
return super._addViewToNativeVisualTree(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import common = require("./progress-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
@@ -67,7 +66,6 @@ export class ProgressStyler implements style.Styler {
|
||||
}
|
||||
|
||||
private static resetBackgroundAndBorderProperty(view: view.View, nativeValue: number) {
|
||||
var bar = <android.widget.ProgressBar>view._nativeView;
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import common = require("./progress-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import proxy = require("ui/core/proxy");
|
||||
import color = require("color");
|
||||
import utils = require("utils/utils")
|
||||
import * as typesModule from "utils/types";
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
import font = require("ui/styling/font");
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import * as typesModule from "utils/types";
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
import font = require("ui/styling/font");
|
||||
|
||||
@@ -5,7 +5,6 @@ import proxy = require("ui/core/proxy");
|
||||
import types = require("utils/types");
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
const R_ID_TABS = 0x01020013;
|
||||
|
||||
@@ -6,7 +6,6 @@ import types = require("utils/types");
|
||||
import * as colorModule from "color";
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import view = require("ui/core/view");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
|
||||
function onValuePropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
@@ -116,7 +115,6 @@ export class SliderStyler implements style.Styler {
|
||||
}
|
||||
|
||||
private static resetBackgroundAndBorderProperty(view: view.View, nativeValue: number) {
|
||||
var bar = <android.widget.SeekBar>view._nativeView;
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@@ -136,4 +134,4 @@ export class SliderStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
SliderStyler.registerHandlers();
|
||||
SliderStyler.registerHandlers();
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import view = require("ui/core/view");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
|
||||
function onValuePropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
@@ -116,4 +115,4 @@ export class SliderStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
SliderStyler.registerHandlers();
|
||||
SliderStyler.registerHandlers();
|
||||
|
||||
@@ -176,7 +176,6 @@ export class Background implements definition.Background {
|
||||
}
|
||||
|
||||
private static parsePosition(pos: string): { x: CSSValue, y: CSSValue } {
|
||||
var res = undefined
|
||||
let values = cssValue(pos);
|
||||
|
||||
if (values.length === 2) {
|
||||
@@ -242,4 +241,4 @@ export class Background implements definition.Background {
|
||||
value1.size === value2.size &&
|
||||
colorModule.Color.equals(value1.color, value2.color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,6 @@ export module ad {
|
||||
let backgroundBoundsF = new android.graphics.RectF(bounds.left + backoffAntialias, bounds.top + backoffAntialias, bounds.right - backoffAntialias, bounds.bottom - backoffAntialias);
|
||||
|
||||
let outerRadius = this._cornerRadius * this._density;
|
||||
let backgroundRadius = Math.max(0, outerRadius - backoffAntialias);
|
||||
|
||||
// draw background
|
||||
if (this.background.color && this.background.color.android) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import utils = require("utils/utils")
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
@@ -57,7 +56,6 @@ export class SwitchStyler implements style.Styler {
|
||||
}
|
||||
|
||||
private static resetColorProperty(view: view.View, nativeValue: number) {
|
||||
var sw = <android.widget.Switch>view._nativeView;
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@@ -71,7 +69,6 @@ export class SwitchStyler implements style.Styler {
|
||||
}
|
||||
|
||||
private static resetBackgroundAndBorderProperty(view: view.View, nativeValue: number) {
|
||||
var sw = <android.widget.Switch>view._nativeView;
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import * as utils from "utils/utils";
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import proxy = require("ui/core/proxy");
|
||||
import color = require("color");
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import * as imageSourceModule from "image-source";
|
||||
|
||||
var imageSource: typeof imageSourceModule;
|
||||
|
||||
@@ -9,8 +9,6 @@ import proxy = require("ui/core/proxy");
|
||||
import color = require("color");
|
||||
import * as imageSourceModule from "image-source";
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import view = require("ui/core/view");
|
||||
import utils = require("utils/utils");
|
||||
import types = require("utils/types");
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import enums = require("ui/enums");
|
||||
|
||||
export class TextBaseStyler implements style.Styler {
|
||||
@@ -167,4 +165,4 @@ export class TextBaseStyler implements style.Styler {
|
||||
TextBaseStyler.setWhiteSpaceProperty,
|
||||
TextBaseStyler.resetWhiteSpaceProperty), "Button");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import view = require("ui/core/view");
|
||||
import utils = require("utils/utils");
|
||||
import types = require("utils/types");
|
||||
import style = require("ui/styling/style");
|
||||
import font = require("ui/styling/font");
|
||||
import styling = require("ui/styling");
|
||||
import enums = require("ui/enums");
|
||||
|
||||
export class TextBaseStyler implements style.Styler {
|
||||
@@ -109,4 +107,4 @@ export class TextBaseStyler implements style.Styler {
|
||||
TextBaseStyler.setWhiteSpaceProperty,
|
||||
TextBaseStyler.resetWhiteSpaceProperty), "TextBase");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export class TextBase extends view.View implements definition.TextBase, formatte
|
||||
return this.style.textAlignment;
|
||||
}
|
||||
set textAlignment(value: string) {
|
||||
this.style.textAlignment;
|
||||
this.style.textAlignment = value;
|
||||
}
|
||||
|
||||
get formattedText(): formattedString.FormattedString {
|
||||
@@ -135,4 +135,4 @@ export class TextBase extends view.View implements definition.TextBase, formatte
|
||||
}
|
||||
}
|
||||
|
||||
tbs.TextBaseStyler.registerHandlers()
|
||||
tbs.TextBaseStyler.registerHandlers()
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import common = require("./text-field-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import textBase = require("ui/text-base");
|
||||
import enums = require("ui/enums");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
import {PropertyChangeData} from "ui/core/dependency-observable";
|
||||
import {PropertyMetadata} from "ui/core/proxy";
|
||||
import {TextBase} from "ui/text-base";
|
||||
import {UpdateTextTrigger} from "ui/enums";
|
||||
import * as style from "ui/styling/style";
|
||||
import {View} from "ui/core/view";
|
||||
|
||||
function onSecurePropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
function onSecurePropertyChanged(data: PropertyChangeData) {
|
||||
var textField = <TextField>data.object;
|
||||
textField.ios.secureTextEntry = data.newValue;
|
||||
}
|
||||
|
||||
(<proxy.PropertyMetadata>common.secureProperty.metadata).onSetNativeValue = onSecurePropertyChanged;
|
||||
(<PropertyMetadata>common.secureProperty.metadata).onSetNativeValue = onSecurePropertyChanged;
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@@ -41,8 +40,8 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate {
|
||||
public textFieldDidEndEditing(textField: UITextField) {
|
||||
let owner = this._owner.get();
|
||||
if (owner) {
|
||||
if (owner.updateTextTrigger === enums.UpdateTextTrigger.focusLost) {
|
||||
owner._onPropertyChangedFromNative(textBase.TextBase.textProperty, textField.text);
|
||||
if (owner.updateTextTrigger === UpdateTextTrigger.focusLost) {
|
||||
owner._onPropertyChangedFromNative(TextBase.textProperty, textField.text);
|
||||
}
|
||||
|
||||
owner.dismissSoftInput();
|
||||
@@ -53,7 +52,7 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate {
|
||||
this.firstEdit = false;
|
||||
let owner = this._owner.get();
|
||||
if (owner) {
|
||||
owner._onPropertyChangedFromNative(textBase.TextBase.textProperty, "");
|
||||
owner._onPropertyChangedFromNative(TextBase.textProperty, "");
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -78,13 +77,13 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate {
|
||||
owner.style._updateTextTransform();
|
||||
textField.selectedTextRange = r;
|
||||
|
||||
if (owner.updateTextTrigger === enums.UpdateTextTrigger.textChanged) {
|
||||
if (owner.updateTextTrigger === UpdateTextTrigger.textChanged) {
|
||||
if (textField.secureTextEntry && this.firstEdit) {
|
||||
owner._onPropertyChangedFromNative(textBase.TextBase.textProperty, replacementString);
|
||||
owner._onPropertyChangedFromNative(TextBase.textProperty, replacementString);
|
||||
}
|
||||
else {
|
||||
let newText = NSString.alloc().initWithString(textField.text).stringByReplacingCharactersInRangeWithString(range, replacementString);
|
||||
owner._onPropertyChangedFromNative(textBase.TextBase.textProperty, newText);
|
||||
owner._onPropertyChangedFromNative(TextBase.textProperty, newText);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,19 +151,19 @@ export class TextField extends common.TextField {
|
||||
return this._ios;
|
||||
}
|
||||
|
||||
public _onHintPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
public _onHintPropertyChanged(data: PropertyChangeData) {
|
||||
var textField = <TextField>data.object;
|
||||
textField.ios.placeholder = data.newValue + "";
|
||||
}
|
||||
}
|
||||
|
||||
export class TextFieldStyler implements style.Styler {
|
||||
private static setColorProperty(view: view.View, newValue: any) {
|
||||
private static setColorProperty(view: View, newValue: any) {
|
||||
var tf: UITextField = <UITextField>view._nativeView;
|
||||
TextFieldStyler._setTextFieldColor(tf, newValue);
|
||||
}
|
||||
|
||||
private static resetColorProperty(view: view.View, nativeValue: any) {
|
||||
private static resetColorProperty(view: View, nativeValue: any) {
|
||||
var tf: UITextField = <UITextField>view._nativeView;
|
||||
TextFieldStyler._setTextFieldColor(tf, nativeValue);
|
||||
}
|
||||
@@ -180,7 +179,7 @@ export class TextFieldStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
private static getNativeColorValue(view: view.View): any {
|
||||
private static getNativeColorValue(view: View): any {
|
||||
var tf: UITextField = <UITextField>view._nativeView;
|
||||
return tf.tintColor;
|
||||
}
|
||||
@@ -193,4 +192,4 @@ export class TextFieldStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
TextFieldStyler.registerHandlers();
|
||||
TextFieldStyler.registerHandlers();
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import common = require("./text-view-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import textBase = require("ui/text-base");
|
||||
import enums = require("ui/enums");
|
||||
import view = require("ui/core/view");
|
||||
import style = require("ui/styling/style");
|
||||
import styling = require("ui/styling");
|
||||
import types = require("utils/types");
|
||||
import {PropertyChangeData} from "ui/core/dependency-observable";
|
||||
import {TextBase} from "ui/text-base";
|
||||
import {UpdateTextTrigger} from "ui/enums";
|
||||
import {View} from "ui/core/view";
|
||||
import * as style from "ui/styling/style";
|
||||
import {isNullOrUndefined} from "utils/types";
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@@ -40,8 +39,8 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate {
|
||||
public textViewDidEndEditing(textView: UITextView) {
|
||||
let owner = this._owner.get();
|
||||
if (owner) {
|
||||
if (owner.updateTextTrigger === enums.UpdateTextTrigger.focusLost) {
|
||||
owner._onPropertyChangedFromNative(textBase.TextBase.textProperty, textView.text);
|
||||
if (owner.updateTextTrigger === UpdateTextTrigger.focusLost) {
|
||||
owner._onPropertyChangedFromNative(TextBase.textProperty, textView.text);
|
||||
}
|
||||
|
||||
owner.dismissSoftInput();
|
||||
@@ -60,8 +59,8 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate {
|
||||
owner.style._updateTextTransform();
|
||||
textView.selectedRange = range;
|
||||
|
||||
if (owner.updateTextTrigger === enums.UpdateTextTrigger.textChanged) {
|
||||
owner._onPropertyChangedFromNative(textBase.TextBase.textProperty, textView.text);
|
||||
if (owner.updateTextTrigger === UpdateTextTrigger.textChanged) {
|
||||
owner._onPropertyChangedFromNative(TextBase.textProperty, textView.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,15 +94,15 @@ export class TextView extends common.TextView {
|
||||
return this._ios;
|
||||
}
|
||||
|
||||
public _onEditablePropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
public _onEditablePropertyChanged(data: PropertyChangeData) {
|
||||
this._ios.editable = data.newValue;
|
||||
}
|
||||
|
||||
public _onHintPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
public _onHintPropertyChanged(data: PropertyChangeData) {
|
||||
this._refreshHintState(data.newValue, this.text);
|
||||
}
|
||||
|
||||
public _onTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
public _onTextPropertyChanged(data: PropertyChangeData) {
|
||||
super._onTextPropertyChanged(data);
|
||||
this._refreshHintState(this.hint, data.newValue);
|
||||
}
|
||||
@@ -119,25 +118,25 @@ export class TextView extends common.TextView {
|
||||
|
||||
public _showHint(hint: string) {
|
||||
this.ios.textColor = this.ios.textColor ? this.ios.textColor.colorWithAlphaComponent(0.22) : UIColor.blackColor().colorWithAlphaComponent(0.22);
|
||||
this.ios.text = types.isNullOrUndefined(hint) ? "" : hint + "";
|
||||
this.ios.text = isNullOrUndefined(hint) ? "" : hint + "";
|
||||
(<any>this.ios).isShowingHint = true;
|
||||
}
|
||||
|
||||
public _hideHint() {
|
||||
this.ios.textColor = this.color ? this.color.ios : null;
|
||||
this.ios.text = types.isNullOrUndefined(this.text) ? "" : this.text + "";
|
||||
this.ios.text = isNullOrUndefined(this.text) ? "" : this.text + "";
|
||||
(<any>this.ios).isShowingHint = false;
|
||||
}
|
||||
}
|
||||
|
||||
export class TextViewStyler implements style.Styler {
|
||||
// Color methods
|
||||
private static setColorProperty(v: view.View, newValue: any) {
|
||||
private static setColorProperty(v: View, newValue: any) {
|
||||
var textView: UITextView = <UITextView>v._nativeView;
|
||||
TextViewStyler._setTextViewColor(textView, newValue);
|
||||
}
|
||||
|
||||
private static resetColorProperty(v: view.View, nativeValue: any) {
|
||||
private static resetColorProperty(v: View, nativeValue: any) {
|
||||
var textView: UITextView = <UITextView>v._nativeView;
|
||||
TextViewStyler._setTextViewColor(textView, nativeValue);
|
||||
}
|
||||
@@ -153,7 +152,7 @@ export class TextViewStyler implements style.Styler {
|
||||
}
|
||||
}
|
||||
|
||||
private static getNativeColorValue(v: view.View): any {
|
||||
private static getNativeColorValue(v: View): any {
|
||||
var textView: UITextView = <UITextView>v._nativeView;
|
||||
if ((<any>textView).isShowingHint && textView.textColor) {
|
||||
return textView.textColor.colorWithAlphaComponent(1);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import common = require("./time-picker-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import utils = require("utils/utils")
|
||||
import {Owned} from "utils/utils";
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@@ -18,7 +17,7 @@ export class TimePicker extends common.TimePicker {
|
||||
var that = new WeakRef(this);
|
||||
|
||||
this._listener = new android.widget.TimePicker.OnTimeChangedListener(
|
||||
<utils.Owned & android.widget.TimePicker.IOnTimeChangedListener>{
|
||||
<Owned & android.widget.TimePicker.IOnTimeChangedListener>{
|
||||
get owner() {
|
||||
return that.get();
|
||||
},
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import common = require("./time-picker-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
import {View} from "ui/core/view";
|
||||
|
||||
function getDate(hour: number, minute: number): NSDate {
|
||||
var comps = NSDateComponents.alloc().init();
|
||||
@@ -98,17 +96,17 @@ class UITimePickerChangeHandlerImpl extends NSObject {
|
||||
|
||||
export class TimePickerStyler implements style.Styler {
|
||||
// color
|
||||
private static setColorProperty(view: view.View, newValue: any) {
|
||||
private static setColorProperty(view: View, newValue: any) {
|
||||
var picker = <UIDatePicker>view._nativeView;
|
||||
picker.setValueForKey(newValue, "textColor");
|
||||
}
|
||||
|
||||
private static resetColorProperty(view: view.View, nativeValue: any) {
|
||||
private static resetColorProperty(view: View, nativeValue: any) {
|
||||
var picker = <UIDatePicker>view._nativeView;
|
||||
picker.setValueForKey(nativeValue, "textColor");
|
||||
}
|
||||
|
||||
private static getColorProperty(view: view.View): any {
|
||||
private static getColorProperty(view: View): any {
|
||||
var picker = <UIDatePicker>view._nativeView;
|
||||
return picker.valueForKey("textColor");
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import transition = require("ui/transition");
|
||||
import platform = require("platform");
|
||||
import {Transition, AndroidTransitionType} from "ui/transition";
|
||||
|
||||
var floatType = java.lang.Float.class.getField("TYPE").get(null);
|
||||
|
||||
export class FadeTransition extends transition.Transition {
|
||||
export class FadeTransition extends Transition {
|
||||
public createAndroidAnimator(transitionType: string): android.animation.Animator {
|
||||
var alphaValues = java.lang.reflect.Array.newInstance(floatType, 2);
|
||||
switch (transitionType) {
|
||||
case transition.AndroidTransitionType.enter:
|
||||
case transition.AndroidTransitionType.popEnter:
|
||||
case AndroidTransitionType.enter:
|
||||
case AndroidTransitionType.popEnter:
|
||||
alphaValues[0] = 0;
|
||||
alphaValues[1] = 1;
|
||||
break;
|
||||
case transition.AndroidTransitionType.exit:
|
||||
case transition.AndroidTransitionType.popExit:
|
||||
case AndroidTransitionType.exit:
|
||||
case AndroidTransitionType.popExit:
|
||||
alphaValues[0] = 1;
|
||||
alphaValues[1] = 0;
|
||||
break;
|
||||
@@ -26,4 +25,4 @@ export class FadeTransition extends transition.Transition {
|
||||
animator.setInterpolator(this.getCurve());
|
||||
return animator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import transition = require("ui/transition");
|
||||
import platform = require("platform");
|
||||
import {Transition, AndroidTransitionType} from "ui/transition";
|
||||
|
||||
var floatType = java.lang.Float.class.getField("TYPE").get(null);
|
||||
|
||||
//http://developer.android.com/training/animation/cardflip.html
|
||||
export class FlipTransition extends transition.Transition {
|
||||
export class FlipTransition extends Transition {
|
||||
private _direction: string;
|
||||
|
||||
constructor(direction: string, duration: number, curve: any) {
|
||||
@@ -22,7 +21,7 @@ export class FlipTransition extends transition.Transition {
|
||||
var rotationY = this._direction === "right" ? 180 : -180;
|
||||
|
||||
switch (transitionType) {
|
||||
case transition.AndroidTransitionType.enter: // card_flip_right_in
|
||||
case AndroidTransitionType.enter: // card_flip_right_in
|
||||
objectAnimators = java.lang.reflect.Array.newInstance(android.animation.Animator.class, 3);
|
||||
|
||||
values = java.lang.reflect.Array.newInstance(floatType, 2);
|
||||
@@ -48,7 +47,7 @@ export class FlipTransition extends transition.Transition {
|
||||
animator.setDuration(1);
|
||||
objectAnimators[2] = animator;
|
||||
break;
|
||||
case transition.AndroidTransitionType.exit: // card_flip_right_out
|
||||
case AndroidTransitionType.exit: // card_flip_right_out
|
||||
objectAnimators = java.lang.reflect.Array.newInstance(android.animation.Animator.class, 2);
|
||||
|
||||
values = java.lang.reflect.Array.newInstance(floatType, 2);
|
||||
@@ -67,7 +66,7 @@ export class FlipTransition extends transition.Transition {
|
||||
animator.setDuration(1);
|
||||
objectAnimators[1] = animator;
|
||||
break;
|
||||
case transition.AndroidTransitionType.popEnter: // card_flip_left_in
|
||||
case AndroidTransitionType.popEnter: // card_flip_left_in
|
||||
objectAnimators = java.lang.reflect.Array.newInstance(android.animation.Animator.class, 3);
|
||||
|
||||
values = java.lang.reflect.Array.newInstance(floatType, 2);
|
||||
@@ -93,7 +92,7 @@ export class FlipTransition extends transition.Transition {
|
||||
animator.setDuration(1);
|
||||
objectAnimators[2] = animator;
|
||||
break;
|
||||
case transition.AndroidTransitionType.popExit: // card_flip_left_out
|
||||
case AndroidTransitionType.popExit: // card_flip_left_out
|
||||
objectAnimators = java.lang.reflect.Array.newInstance(android.animation.Animator.class, 2);
|
||||
|
||||
values = java.lang.reflect.Array.newInstance(floatType, 2);
|
||||
@@ -117,4 +116,4 @@ export class FlipTransition extends transition.Transition {
|
||||
animatorSet.playTogether(objectAnimators);
|
||||
return animatorSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ class AnimatedTransitioning extends NSObject implements UIViewControllerAnimated
|
||||
}
|
||||
}
|
||||
|
||||
var transitionId = 0;
|
||||
export class Transition implements definition.Transition {
|
||||
private _duration: number;
|
||||
private _curve: UIViewAnimationCurve;
|
||||
|
||||
Reference in New Issue
Block a user