feat:Android LinearNode setBaselineAligned false

This commit is contained in:
刘涛 2020-07-03 16:53:31 +08:00 committed by osborn
parent ae5ac30fb6
commit 787ea71862
24 changed files with 4510 additions and 4769 deletions

View File

@ -20,12 +20,12 @@ import android.graphics.drawable.ShapeDrawable;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import pub.doric.DoricContext;
import pub.doric.utils.DoricUtils;
import com.github.pengfeizhou.jscore.JSObject; import com.github.pengfeizhou.jscore.JSObject;
import com.github.pengfeizhou.jscore.JSValue; import com.github.pengfeizhou.jscore.JSValue;
import pub.doric.DoricContext;
import pub.doric.utils.DoricUtils;
/** /**
* @Description: com.github.penfeizhou.doric.shader * @Description: com.github.penfeizhou.doric.shader
* @Author: pengfei.zhou * @Author: pengfei.zhou
@ -94,7 +94,9 @@ public class LinearNode extends GroupNode<LinearLayout> {
@Override @Override
protected LinearLayout build() { protected LinearLayout build() {
return new MaximumLinearLayout(getContext()); LinearLayout linearLayout= new MaximumLinearLayout(getContext());
linearLayout.setBaselineAligned(false);
return linearLayout;
} }
@Override @Override

View File

@ -1,4 +1,4 @@
import { Panel, Group, scroller, vlayout, layoutConfig, LayoutSpec, Input, Gravity, log, input, text, Color, Text, InputType } from "doric"; import { Panel, Group, scroller, vlayout, layoutConfig, LayoutSpec, Input, Gravity, log, input, text, Color, Text, InputType, hlayout } from "doric";
import { title } from "./utils"; import { title } from "./utils";
@Entry @Entry
class TextDemo extends Panel { class TextDemo extends Panel {
@ -8,34 +8,33 @@ class TextDemo extends Panel {
[ [
title("Text Demo"), title("Text Demo"),
input({ input({
width : 100, width: 100,
height:100, height: 100,
inputType: InputType.Number, inputType: InputType.Number,
hintText: "number" hintText: "number"
}), }),
hlayout([
// input({ text({
// width : 100, text: "size 10",
// height:100, textSize: 10,
// inputType: InputType.NumberSigned, backgroundColor: Color.GREEN
// hintText: "NumberSigned" }),
// }), text({
text: "size 25",
// input({ textSize: 25,
// width : 100, backgroundColor: Color.BLUE
// height:100, }),
// inputType: InputType.Alphabet, text({
// hintText: "Alphabet" text: "size 18",
// }), textSize: 18,
backgroundColor: Color.LTGRAY,
// input({ })
// width : 100, ], {
// height:100, backgroundColor: Color.RED,
// inputType: InputType.Phone, height: 50,
// hintText: "Phone" gravity: Gravity.CenterX,
layoutConfig: layoutConfig().configWidth(LayoutSpec.MOST).configHeight(LayoutSpec.JUST),
// }), }),
text({ text({
text: "This is normal text", text: "This is normal text",
}), }),

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -33,8 +33,7 @@ export function NativeCall(target, propertyKey, descriptor) {
}; };
return descriptor; return descriptor;
} }
let Panel = /** @class */ (() => { export class Panel {
class Panel {
constructor() { constructor() {
this.destroyed = false; this.destroyed = false;
this.__root__ = new Root; this.__root__ = new Root;
@ -216,49 +215,46 @@ let Panel = /** @class */ (() => {
addOnRenderFinishedCallback(cb) { addOnRenderFinishedCallback(cb) {
this.onRenderFinishedCallback.push(cb); this.onRenderFinishedCallback.push(cb);
} }
} }
__decorate([ __decorate([
NativeCall, NativeCall,
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [String]), __metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)
], Panel.prototype, "__init__", null); ], Panel.prototype, "__init__", null);
__decorate([ __decorate([
NativeCall, NativeCall,
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", []), __metadata("design:paramtypes", []),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)
], Panel.prototype, "__onCreate__", null); ], Panel.prototype, "__onCreate__", null);
__decorate([ __decorate([
NativeCall, NativeCall,
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", []), __metadata("design:paramtypes", []),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)
], Panel.prototype, "__onDestroy__", null); ], Panel.prototype, "__onDestroy__", null);
__decorate([ __decorate([
NativeCall, NativeCall,
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", []), __metadata("design:paramtypes", []),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)
], Panel.prototype, "__onShow__", null); ], Panel.prototype, "__onShow__", null);
__decorate([ __decorate([
NativeCall, NativeCall,
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", []), __metadata("design:paramtypes", []),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)
], Panel.prototype, "__onHidden__", null); ], Panel.prototype, "__onHidden__", null);
__decorate([ __decorate([
NativeCall, NativeCall,
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [Object]), __metadata("design:paramtypes", [Object]),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)
], Panel.prototype, "__build__", null); ], Panel.prototype, "__build__", null);
__decorate([ __decorate([
NativeCall, NativeCall,
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [Array, String]), __metadata("design:paramtypes", [Array, String]),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)
], Panel.prototype, "__response__", null); ], Panel.prototype, "__response__", null);
return Panel;
})();
export { Panel };

View File

@ -13,8 +13,7 @@ import { loge } from "../util/log";
export function Property(target, propKey) { export function Property(target, propKey) {
Reflect.defineMetadata(propKey, true, target); Reflect.defineMetadata(propKey, true, target);
} }
let View = /** @class */ (() => { export class View {
class View {
constructor() { constructor() {
this.width = 0; this.width = 0;
this.height = 0; this.height = 0;
@ -186,106 +185,103 @@ let View = /** @class */ (() => {
} }
}); });
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "width", void 0); ], View.prototype, "width", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "height", void 0); ], View.prototype, "height", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "x", void 0); ], View.prototype, "x", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "y", void 0); ], View.prototype, "y", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], View.prototype, "backgroundColor", void 0); ], View.prototype, "backgroundColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], View.prototype, "corners", void 0); ], View.prototype, "corners", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], View.prototype, "border", void 0); ], View.prototype, "border", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], View.prototype, "shadow", void 0); ], View.prototype, "shadow", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "alpha", void 0); ], View.prototype, "alpha", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], View.prototype, "hidden", void 0); ], View.prototype, "hidden", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], View.prototype, "padding", void 0); ], View.prototype, "padding", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], View.prototype, "layoutConfig", void 0); ], View.prototype, "layoutConfig", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], View.prototype, "onClick", void 0); ], View.prototype, "onClick", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "translationX", void 0); ], View.prototype, "translationX", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "translationY", void 0); ], View.prototype, "translationY", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "scaleX", void 0); ], View.prototype, "scaleX", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "scaleY", void 0); ], View.prototype, "scaleY", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "pivotX", void 0); ], View.prototype, "pivotX", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "pivotY", void 0); ], View.prototype, "pivotY", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "rotation", void 0); ], View.prototype, "rotation", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "rotationX", void 0); ], View.prototype, "rotationX", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "rotationY", void 0); ], View.prototype, "rotationY", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], View.prototype, "perspective", void 0); ], View.prototype, "perspective", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], View.prototype, "flexConfig", void 0); ], View.prototype, "flexConfig", void 0);
return View;
})();
export { View };
export class Superview extends View { export class Superview extends View {
subviewById(id) { subviewById(id) {
for (let v of this.allSubviews()) { for (let v of this.allSubviews()) {

View File

@ -1,8 +1,7 @@
/** /**
* Store color as format AARRGGBB or RRGGBB * Store color as format AARRGGBB or RRGGBB
*/ */
let Color = /** @class */ (() => { export class Color {
class Color {
constructor(v) { constructor(v) {
this._value = 0; this._value = 0;
this._value = v | 0x0; this._value = v | 0x0;
@ -40,22 +39,19 @@ let Color = /** @class */ (() => {
toModel() { toModel() {
return this._value; return this._value;
} }
} }
Color.BLACK = new Color(0xFF000000); Color.BLACK = new Color(0xFF000000);
Color.DKGRAY = new Color(0xFF444444); Color.DKGRAY = new Color(0xFF444444);
Color.GRAY = new Color(0xFF888888); Color.GRAY = new Color(0xFF888888);
Color.LTGRAY = new Color(0xFFCCCCCC); Color.LTGRAY = new Color(0xFFCCCCCC);
Color.WHITE = new Color(0xFFFFFFFF); Color.WHITE = new Color(0xFFFFFFFF);
Color.RED = new Color(0xFFFF0000); Color.RED = new Color(0xFFFF0000);
Color.GREEN = new Color(0xFF00FF00); Color.GREEN = new Color(0xFF00FF00);
Color.BLUE = new Color(0xFF0000FF); Color.BLUE = new Color(0xFF0000FF);
Color.YELLOW = new Color(0xFFFFFF00); Color.YELLOW = new Color(0xFFFFFF00);
Color.CYAN = new Color(0xFF00FFFF); Color.CYAN = new Color(0xFF00FFFF);
Color.MAGENTA = new Color(0xFFFF00FF); Color.MAGENTA = new Color(0xFFFF00FF);
Color.TRANSPARENT = new Color(0); Color.TRANSPARENT = new Color(0);
return Color;
})();
export { Color };
export var GradientOrientation; export var GradientOrientation;
(function (GradientOrientation) { (function (GradientOrientation) {
/** draw the gradient from the top to the bottom */ /** draw the gradient from the top to the bottom */

View File

@ -5,8 +5,7 @@ var ValueType;
ValueType[ValueType["Percent"] = 2] = "Percent"; ValueType[ValueType["Percent"] = 2] = "Percent";
ValueType[ValueType["Auto"] = 3] = "Auto"; ValueType[ValueType["Auto"] = 3] = "Auto";
})(ValueType || (ValueType = {})); })(ValueType || (ValueType = {}));
let FlexTypedValue = /** @class */ (() => { export class FlexTypedValue {
class FlexTypedValue {
constructor(type) { constructor(type) {
this.value = 0; this.value = 0;
this.type = type; this.type = type;
@ -27,11 +26,8 @@ let FlexTypedValue = /** @class */ (() => {
value: this.value, value: this.value,
}; };
} }
} }
FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
return FlexTypedValue;
})();
export { FlexTypedValue };
export var FlexDirection; export var FlexDirection;
(function (FlexDirection) { (function (FlexDirection) {
FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN"; FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN";

View File

@ -10,8 +10,7 @@ export const BOTTOM = (END | SPECIFIED) << SHIFT_Y;
export const CENTER_X = SPECIFIED << SHIFT_X; export const CENTER_X = SPECIFIED << SHIFT_X;
export const CENTER_Y = SPECIFIED << SHIFT_Y; export const CENTER_Y = SPECIFIED << SHIFT_Y;
export const CENTER = CENTER_X | CENTER_Y; export const CENTER = CENTER_X | CENTER_Y;
let Gravity = /** @class */ (() => { export class Gravity {
class Gravity {
constructor() { constructor() {
this.val = 0; this.val = 0;
} }
@ -60,18 +59,15 @@ let Gravity = /** @class */ (() => {
toModel() { toModel() {
return this.val; return this.val;
} }
} }
Gravity.origin = new Gravity; Gravity.origin = new Gravity;
Gravity.Center = Gravity.origin.center(); Gravity.Center = Gravity.origin.center();
Gravity.CenterX = Gravity.origin.centerX(); Gravity.CenterX = Gravity.origin.centerX();
Gravity.CenterY = Gravity.origin.centerY(); Gravity.CenterY = Gravity.origin.centerY();
Gravity.Left = Gravity.origin.left(); Gravity.Left = Gravity.origin.left();
Gravity.Right = Gravity.origin.right(); Gravity.Right = Gravity.origin.right();
Gravity.Top = Gravity.origin.top(); Gravity.Top = Gravity.origin.top();
Gravity.Bottom = Gravity.origin.bottom(); Gravity.Bottom = Gravity.origin.bottom();
return Gravity;
})();
export { Gravity };
export function gravity() { export function gravity() {
return new Gravity; return new Gravity;
} }

View File

@ -25,16 +25,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { Property, View } from "../ui/view"; import { Property, View } from "../ui/view";
import { Stack } from "../widget/layouts"; import { Stack } from "../widget/layouts";
import { layoutConfig } from "../util/layoutconfig"; import { layoutConfig } from "../util/layoutconfig";
let Draggable = /** @class */ (() => { export class Draggable extends Stack {
class Draggable extends Stack { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Draggable.prototype, "onDrag", void 0); ], Draggable.prototype, "onDrag", void 0);
return Draggable;
})();
export { Draggable };
export function draggable(views, config) { export function draggable(views, config) {
const ret = new Draggable; const ret = new Draggable;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

View File

@ -25,18 +25,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { Stack } from './layouts'; import { Stack } from './layouts';
import { Property, Superview, View } from '../ui/view'; import { Property, Superview, View } from '../ui/view';
import { layoutConfig } from '../util/index.util'; import { layoutConfig } from '../util/index.util';
let FlowLayoutItem = /** @class */ (() => { export class FlowLayoutItem extends Stack {
class FlowLayoutItem extends Stack { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], FlowLayoutItem.prototype, "identifier", void 0); ], FlowLayoutItem.prototype, "identifier", void 0);
return FlowLayoutItem; export class FlowLayout extends Superview {
})();
export { FlowLayoutItem };
let FlowLayout = /** @class */ (() => {
class FlowLayout extends Superview {
constructor() { constructor() {
super(...arguments); super(...arguments);
this.cachedViews = new Map; this.cachedViews = new Map;
@ -84,54 +79,51 @@ let FlowLayout = /** @class */ (() => {
} }
return super.toModel(); return super.toModel();
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], FlowLayout.prototype, "columnCount", void 0); ], FlowLayout.prototype, "columnCount", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], FlowLayout.prototype, "columnSpace", void 0); ], FlowLayout.prototype, "columnSpace", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], FlowLayout.prototype, "rowSpace", void 0); ], FlowLayout.prototype, "rowSpace", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], FlowLayout.prototype, "itemCount", void 0); ], FlowLayout.prototype, "itemCount", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], FlowLayout.prototype, "renderItem", void 0); ], FlowLayout.prototype, "renderItem", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], FlowLayout.prototype, "batchCount", void 0); ], FlowLayout.prototype, "batchCount", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], FlowLayout.prototype, "onLoadMore", void 0); ], FlowLayout.prototype, "onLoadMore", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], FlowLayout.prototype, "loadMore", void 0); ], FlowLayout.prototype, "loadMore", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", FlowLayoutItem) __metadata("design:type", FlowLayoutItem)
], FlowLayout.prototype, "loadMoreView", void 0); ], FlowLayout.prototype, "loadMoreView", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], FlowLayout.prototype, "onScroll", void 0); ], FlowLayout.prototype, "onScroll", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], FlowLayout.prototype, "onScrollEnd", void 0); ], FlowLayout.prototype, "onScrollEnd", void 0);
return FlowLayout;
})();
export { FlowLayout };
export function flowlayout(config) { export function flowlayout(config) {
const ret = new FlowLayout; const ret = new FlowLayout;
for (let key in config) { for (let key in config) {

View File

@ -31,42 +31,41 @@ export var ScaleType;
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit"; ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill"; ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
})(ScaleType || (ScaleType = {})); })(ScaleType || (ScaleType = {}));
let Image = /** @class */ (() => { export class Image extends View {
class Image extends View { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "imageUrl", void 0); ], Image.prototype, "imageUrl", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "imagePath", void 0); ], Image.prototype, "imagePath", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "imageRes", void 0); ], Image.prototype, "imageRes", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "imageBase64", void 0); ], Image.prototype, "imageBase64", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Image.prototype, "scaleType", void 0); ], Image.prototype, "scaleType", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], Image.prototype, "isBlur", void 0); ], Image.prototype, "isBlur", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "placeHolderImage", void 0); ], Image.prototype, "placeHolderImage", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "placeHolderImageBase64", void 0); ], Image.prototype, "placeHolderImageBase64", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color __metadata("design:type", Color
/** /**
@ -74,34 +73,31 @@ let Image = /** @class */ (() => {
* It can be file name in local path * It can be file name in local path
*/ */
) )
], Image.prototype, "placeHolderColor", void 0); ], Image.prototype, "placeHolderColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "errorImage", void 0); ], Image.prototype, "errorImage", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Image.prototype, "errorImageBase64", void 0); ], Image.prototype, "errorImageBase64", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color) __metadata("design:type", Color)
], Image.prototype, "errorColor", void 0); ], Image.prototype, "errorColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Image.prototype, "loadCallback", void 0); ], Image.prototype, "loadCallback", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Image.prototype, "imageScale", void 0); ], Image.prototype, "imageScale", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], Image.prototype, "stretchInset", void 0); ], Image.prototype, "stretchInset", void 0);
return Image;
})();
export { Image };
export function image(config) { export function image(config) {
const ret = new Image; const ret = new Image;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

View File

@ -26,8 +26,7 @@ import { View, Property } from "../ui/view";
import { Color } from "../util/color"; import { Color } from "../util/color";
import { Gravity } from "../util/gravity"; import { Gravity } from "../util/gravity";
import { layoutConfig } from "../util/index.util"; import { layoutConfig } from "../util/index.util";
let Input = /** @class */ (() => { export class Input extends View {
class Input extends View {
getText(context) { getText(context) {
return this.nativeChannel(context, 'getText')(); return this.nativeChannel(context, 'getText')();
} }
@ -43,54 +42,51 @@ let Input = /** @class */ (() => {
releaseFocus(context) { releaseFocus(context) {
return this.nativeChannel(context, 'releaseFocus')(); return this.nativeChannel(context, 'releaseFocus')();
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Input.prototype, "text", void 0); ], Input.prototype, "text", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color) __metadata("design:type", Color)
], Input.prototype, "textColor", void 0); ], Input.prototype, "textColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Input.prototype, "textSize", void 0); ], Input.prototype, "textSize", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Input.prototype, "hintText", void 0); ], Input.prototype, "hintText", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Input.prototype, "inputType", void 0); ], Input.prototype, "inputType", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color) __metadata("design:type", Color)
], Input.prototype, "hintTextColor", void 0); ], Input.prototype, "hintTextColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], Input.prototype, "multiline", void 0); ], Input.prototype, "multiline", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Gravity) __metadata("design:type", Gravity)
], Input.prototype, "textAlignment", void 0); ], Input.prototype, "textAlignment", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Input.prototype, "onTextChange", void 0); ], Input.prototype, "onTextChange", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Input.prototype, "onFocusChange", void 0); ], Input.prototype, "onFocusChange", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Input.prototype, "maxLength", void 0); ], Input.prototype, "maxLength", void 0);
return Input;
})();
export { Input };
export var InputType; export var InputType;
(function (InputType) { (function (InputType) {
InputType[InputType["Default"] = 0] = "Default"; InputType[InputType["Default"] = 0] = "Default";

View File

@ -29,19 +29,16 @@ export class Stack extends Group {
} }
export class Root extends Stack { export class Root extends Stack {
} }
let LinearLayout = /** @class */ (() => { class LinearLayout extends Group {
class LinearLayout extends Group { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], LinearLayout.prototype, "space", void 0); ], LinearLayout.prototype, "space", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Gravity) __metadata("design:type", Gravity)
], LinearLayout.prototype, "gravity", void 0); ], LinearLayout.prototype, "gravity", void 0);
return LinearLayout;
})();
export class VLayout extends LinearLayout { export class VLayout extends LinearLayout {
} }
export class HLayout extends LinearLayout { export class HLayout extends LinearLayout {

View File

@ -25,18 +25,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { View, Property, Superview } from "../ui/view"; import { View, Property, Superview } from "../ui/view";
import { Stack } from "./layouts"; import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig"; import { layoutConfig } from "../util/layoutconfig";
let ListItem = /** @class */ (() => { export class ListItem extends Stack {
class ListItem extends Stack { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], ListItem.prototype, "identifier", void 0); ], ListItem.prototype, "identifier", void 0);
return ListItem; export class List extends Superview {
})();
export { ListItem };
let List = /** @class */ (() => {
class List extends Superview {
constructor() { constructor() {
super(...arguments); super(...arguments);
this.cachedViews = new Map; this.cachedViews = new Map;
@ -87,46 +82,43 @@ let List = /** @class */ (() => {
} }
return super.toModel(); return super.toModel();
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], List.prototype, "itemCount", void 0); ], List.prototype, "itemCount", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], List.prototype, "renderItem", void 0); ], List.prototype, "renderItem", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], List.prototype, "batchCount", void 0); ], List.prototype, "batchCount", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], List.prototype, "onLoadMore", void 0); ], List.prototype, "onLoadMore", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], List.prototype, "loadMore", void 0); ], List.prototype, "loadMore", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", ListItem) __metadata("design:type", ListItem)
], List.prototype, "loadMoreView", void 0); ], List.prototype, "loadMoreView", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], List.prototype, "onScroll", void 0); ], List.prototype, "onScroll", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], List.prototype, "onScrollEnd", void 0); ], List.prototype, "onScrollEnd", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], List.prototype, "scrolledPosition", void 0); ], List.prototype, "scrolledPosition", void 0);
return List;
})();
export { List };
export function list(config) { export function list(config) {
const ret = new List; const ret = new List;
for (let key in config) { for (let key in config) {

View File

@ -23,8 +23,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
* limitations under the License. * limitations under the License.
*/ */
import { Group, Property } from '../ui/view'; import { Group, Property } from '../ui/view';
let NestedSlider = /** @class */ (() => { export class NestedSlider extends Group {
class NestedSlider extends Group {
addSlideItem(view) { addSlideItem(view) {
this.addChild(view); this.addChild(view);
} }
@ -34,11 +33,8 @@ let NestedSlider = /** @class */ (() => {
getSlidedPage(context) { getSlidedPage(context) {
return this.nativeChannel(context, "getSlidedPage")(); return this.nativeChannel(context, "getSlidedPage")();
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], NestedSlider.prototype, "onPageSlided", void 0); ], NestedSlider.prototype, "onPageSlided", void 0);
return NestedSlider;
})();
export { NestedSlider };

View File

@ -9,8 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
}; };
import { Property, Superview } from "../ui/view"; import { Property, Superview } from "../ui/view";
import { layoutConfig } from "../util/layoutconfig"; import { layoutConfig } from "../util/layoutconfig";
let Refreshable = /** @class */ (() => { export class Refreshable extends Superview {
class Refreshable extends Superview {
allSubviews() { allSubviews() {
const ret = [this.content]; const ret = [this.content];
if (this.header) { if (this.header) {
@ -35,14 +34,11 @@ let Refreshable = /** @class */ (() => {
this.dirtyProps.header = (this.header || {}).viewId; this.dirtyProps.header = (this.header || {}).viewId;
return super.toModel(); return super.toModel();
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Refreshable.prototype, "onRefresh", void 0); ], Refreshable.prototype, "onRefresh", void 0);
return Refreshable;
})();
export { Refreshable };
export function refreshable(config) { export function refreshable(config) {
const ret = new Refreshable; const ret = new Refreshable;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

View File

@ -35,8 +35,7 @@ export function scroller(content, config) {
v.content = content; v.content = content;
}); });
} }
let Scroller = /** @class */ (() => { export class Scroller extends Superview {
class Scroller extends Superview {
allSubviews() { allSubviews() {
return [this.content]; return [this.content];
} }
@ -50,19 +49,16 @@ let Scroller = /** @class */ (() => {
scrollBy(context, offset, animated) { scrollBy(context, offset, animated) {
return this.nativeChannel(context, "scrollBy")({ offset, animated }); return this.nativeChannel(context, "scrollBy")({ offset, animated });
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], Scroller.prototype, "contentOffset", void 0); ], Scroller.prototype, "contentOffset", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Scroller.prototype, "onScroll", void 0); ], Scroller.prototype, "onScroll", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Scroller.prototype, "onScrollEnd", void 0); ], Scroller.prototype, "onScrollEnd", void 0);
return Scroller;
})();
export { Scroller };

View File

@ -25,18 +25,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { Superview, View, Property } from "../ui/view"; import { Superview, View, Property } from "../ui/view";
import { Stack } from "./layouts"; import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig"; import { layoutConfig } from "../util/layoutconfig";
let SlideItem = /** @class */ (() => { export class SlideItem extends Stack {
class SlideItem extends Stack { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], SlideItem.prototype, "identifier", void 0); ], SlideItem.prototype, "identifier", void 0);
return SlideItem; export class Slider extends Superview {
})();
export { SlideItem };
let Slider = /** @class */ (() => {
class Slider extends Superview {
constructor() { constructor() {
super(...arguments); super(...arguments);
this.cachedViews = new Map; this.cachedViews = new Map;
@ -74,30 +69,27 @@ let Slider = /** @class */ (() => {
getSlidedPage(context) { getSlidedPage(context) {
return this.nativeChannel(context, "getSlidedPage")(); return this.nativeChannel(context, "getSlidedPage")();
} }
} }
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], Slider.prototype, "itemCount", void 0); ], Slider.prototype, "itemCount", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Slider.prototype, "renderPage", void 0); ], Slider.prototype, "renderPage", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], Slider.prototype, "batchCount", void 0); ], Slider.prototype, "batchCount", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Slider.prototype, "onPageSlided", void 0); ], Slider.prototype, "onPageSlided", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], Slider.prototype, "loop", void 0); ], Slider.prototype, "loop", void 0);
return Slider;
})();
export { Slider };
export function slider(config) { export function slider(config) {
const ret = new Slider; const ret = new Slider;
for (let key in config) { for (let key in config) {

View File

@ -25,32 +25,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { View, Property } from "../ui/view"; import { View, Property } from "../ui/view";
import { Color } from "../util/color"; import { Color } from "../util/color";
import { layoutConfig } from "../util/index.util"; import { layoutConfig } from "../util/index.util";
let Switch = /** @class */ (() => { export class Switch extends View {
class Switch extends View { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], Switch.prototype, "state", void 0); ], Switch.prototype, "state", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Function) __metadata("design:type", Function)
], Switch.prototype, "onSwitch", void 0); ], Switch.prototype, "onSwitch", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color) __metadata("design:type", Color)
], Switch.prototype, "offTintColor", void 0); ], Switch.prototype, "offTintColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color) __metadata("design:type", Color)
], Switch.prototype, "onTintColor", void 0); ], Switch.prototype, "onTintColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color) __metadata("design:type", Color)
], Switch.prototype, "thumbTintColor", void 0); ], Switch.prototype, "thumbTintColor", void 0);
return Switch;
})();
export { Switch };
export function switchView(config) { export function switchView(config) {
const ret = new Switch; const ret = new Switch;
ret.layoutConfig = layoutConfig().just(); ret.layoutConfig = layoutConfig().just();

View File

@ -33,68 +33,64 @@ export var TruncateAt;
TruncateAt[TruncateAt["Start"] = 2] = "Start"; TruncateAt[TruncateAt["Start"] = 2] = "Start";
TruncateAt[TruncateAt["Clip"] = 3] = "Clip"; TruncateAt[TruncateAt["Clip"] = 3] = "Clip";
})(TruncateAt || (TruncateAt = {})); })(TruncateAt || (TruncateAt = {}));
let Text = /** @class */ (() => { export class Text extends View {
class Text extends View { }
} __decorate([
__decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Text.prototype, "text", void 0); ], Text.prototype, "text", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Color) __metadata("design:type", Color)
], Text.prototype, "textColor", void 0); ], Text.prototype, "textColor", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Text.prototype, "textSize", void 0); ], Text.prototype, "textSize", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Text.prototype, "maxLines", void 0); ], Text.prototype, "maxLines", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Gravity) __metadata("design:type", Gravity)
], Text.prototype, "textAlignment", void 0); ], Text.prototype, "textAlignment", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Text.prototype, "fontStyle", void 0); ], Text.prototype, "fontStyle", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Text.prototype, "font", void 0); ], Text.prototype, "font", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Text.prototype, "maxWidth", void 0); ], Text.prototype, "maxWidth", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Text.prototype, "maxHeight", void 0); ], Text.prototype, "maxHeight", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Text.prototype, "lineSpacing", void 0); ], Text.prototype, "lineSpacing", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], Text.prototype, "strikethrough", void 0); ], Text.prototype, "strikethrough", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Boolean) __metadata("design:type", Boolean)
], Text.prototype, "underline", void 0); ], Text.prototype, "underline", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", String) __metadata("design:type", String)
], Text.prototype, "htmlText", void 0); ], Text.prototype, "htmlText", void 0);
__decorate([ __decorate([
Property, Property,
__metadata("design:type", Number) __metadata("design:type", Number)
], Text.prototype, "truncateAt", void 0); ], Text.prototype, "truncateAt", void 0);
return Text;
})();
export { Text };
export function text(config) { export function text(config) {
const ret = new Text; const ret = new Text;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

View File

@ -38,7 +38,6 @@ export abstract class ViewModel<M extends Object, V extends ViewHolder> {
getViewHolder() { getViewHolder() {
return this.viewHolder; return this.viewHolder;
} }
updateState(setter: Setter<M>) { updateState(setter: Setter<M>) {
setter(this.state) setter(this.state)
this.onBind(this.state, this.viewHolder) this.onBind(this.state, this.viewHolder)

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long