mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Fix merge error
This commit is contained in:
142
org.nativescript.widgets.d.ts
vendored
Normal file
142
org.nativescript.widgets.d.ts
vendored
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
declare module org {
|
||||||
|
module nativescript {
|
||||||
|
module widgets {
|
||||||
|
export class CommonLayoutParams extends android.widget.FrameLayout.LayoutParams {
|
||||||
|
constructor();
|
||||||
|
|
||||||
|
public left: number;
|
||||||
|
public top: number;
|
||||||
|
|
||||||
|
public dock: Dock;
|
||||||
|
|
||||||
|
public row: number;
|
||||||
|
public column: number;
|
||||||
|
|
||||||
|
public rowSpan: number;
|
||||||
|
public columnSpan: number;
|
||||||
|
|
||||||
|
public horizontalAlignment: HorizontalAlignment;
|
||||||
|
public verticalAlignment: VerticalAlignment;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum Stretch {
|
||||||
|
none,
|
||||||
|
aspectFill,
|
||||||
|
aspectFit,
|
||||||
|
fill
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum HorizontalAlignment {
|
||||||
|
left,
|
||||||
|
center,
|
||||||
|
right,
|
||||||
|
stretch
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum VerticalAlignment {
|
||||||
|
top,
|
||||||
|
center,
|
||||||
|
bottom,
|
||||||
|
stretch
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum Dock {
|
||||||
|
left,
|
||||||
|
top,
|
||||||
|
right,
|
||||||
|
bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum GridUnitType {
|
||||||
|
auto,
|
||||||
|
pixel,
|
||||||
|
star
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum Orientation {
|
||||||
|
horzontal,
|
||||||
|
vertical
|
||||||
|
}
|
||||||
|
|
||||||
|
export class LayoutBase extends android.view.ViewGroup {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AbsoluteLayout extends LayoutBase {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DockLayout extends LayoutBase {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
|
||||||
|
public getStretchLastChild(): boolean;
|
||||||
|
public setStretchLastChild(value: boolean): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class StackLayout extends LayoutBase {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
|
||||||
|
public getOrientation(): Orientation;
|
||||||
|
public setOrientation(value: Orientation): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class WrapLayout extends LayoutBase {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
|
||||||
|
public getOrientation(): Orientation;
|
||||||
|
public setOrientation(value: Orientation): void;
|
||||||
|
|
||||||
|
public getItemWidth(): number;
|
||||||
|
public setItemWidth(value: number): void;
|
||||||
|
|
||||||
|
public getItemHeight(): number;
|
||||||
|
public setItemHeight(value: number): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ItemSpec {
|
||||||
|
constructor();
|
||||||
|
constructor(value: number, unitType: GridUnitType);
|
||||||
|
public getGridUnitType(): GridUnitType;
|
||||||
|
public getIsAbsolute(): boolean;
|
||||||
|
public getIsAuto(): boolean;
|
||||||
|
public getIsStar(): boolean;
|
||||||
|
public getValue(): number;
|
||||||
|
public getActualLength(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GridLayout extends LayoutBase {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
|
||||||
|
public addRow(itemSpec: ItemSpec): void;
|
||||||
|
public addColumn(itemSpec: ItemSpec): void;
|
||||||
|
|
||||||
|
public removeRow(itemSpec: ItemSpec): void;
|
||||||
|
public removeColumn(itemSpec: ItemSpec): void;
|
||||||
|
|
||||||
|
public removeRowAt(index: number): void;
|
||||||
|
public removeColumnAt(index: number): void;
|
||||||
|
|
||||||
|
public getColumns(): Array<ItemSpec>;
|
||||||
|
public getRows(): Array<ItemSpec>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ContentLayout extends LayoutBase {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
}
|
||||||
|
|
||||||
|
export class VerticalScrollView extends android.widget.ScrollView {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
public getScrollableLength(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class HorizontalScrollView extends android.widget.HorizontalScrollView {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
public getScrollableLength(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ImageView extends android.widget.ImageView {
|
||||||
|
constructor(context: android.content.Context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -147,40 +147,6 @@ function isMinWidthHeightValid(value: number): boolean {
|
|||||||
return !isNaN(value) && value >= 0.0 && isFinite(value);
|
return !isNaN(value) && value >= 0.0 && isFinite(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBackgroundImagePropertyChanged(data: observable.PropertyChangeData) {
|
|
||||||
var view: view.View = (<any>data.object)._view;
|
|
||||||
var style = <Style>data.object;
|
|
||||||
var url: string = data.newValue;
|
|
||||||
|
|
||||||
style._setValue(backgroundImageSourceProperty, undefined, observable.ValueSource.Local);
|
|
||||||
|
|
||||||
if (types.isString(data.newValue)) {
|
|
||||||
var pattern: RegExp = /url\(('|")(.*?)\1\)/;
|
|
||||||
var match = url.match(pattern);
|
|
||||||
if (match && match[2]) {
|
|
||||||
url = match[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (utils.isDataURI(url)) {
|
|
||||||
var base64Data = url.split(",")[1];
|
|
||||||
if (types.isDefined(base64Data)) {
|
|
||||||
style._setValue(backgroundImageSourceProperty, imageSource.fromBase64(base64Data), observable.ValueSource.Local);
|
|
||||||
}
|
|
||||||
} else if (utils.isFileOrResourcePath(url)) {
|
|
||||||
style._setValue(backgroundImageSourceProperty, imageSource.fromFileOrResource(url), observable.ValueSource.Local);
|
|
||||||
} else if (url.indexOf("http") !== -1) {
|
|
||||||
if (view) {
|
|
||||||
view["_url"] = url;
|
|
||||||
}
|
|
||||||
imageSource.fromUrl(url).then(r=> {
|
|
||||||
if (view && view["_url"] === url) {
|
|
||||||
style._setValue(backgroundImageSourceProperty, r, observable.ValueSource.Local);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getHandlerInternal(propertyId: number, classInfo: types.ClassInfo): styling.stylers.StylePropertyChangedHandler {
|
function getHandlerInternal(propertyId: number, classInfo: types.ClassInfo): styling.stylers.StylePropertyChangedHandler {
|
||||||
var className = classInfo ? classInfo.name : "default";
|
var className = classInfo ? classInfo.name : "default";
|
||||||
var handlerKey = className + propertyId;
|
var handlerKey = className + propertyId;
|
||||||
|
Reference in New Issue
Block a user