iOS:add FlexLayoutNode

This commit is contained in:
pengfei.zhou
2020-04-09 20:01:22 +08:00
committed by osborn
parent 404b4b594f
commit 6f09341723
16 changed files with 697 additions and 69 deletions

View File

@@ -3,6 +3,7 @@ import { Modeling, Model } from "../util/types";
import { BridgeContext } from "../runtime/global";
import { LayoutConfig } from '../util/layoutconfig';
import { IAnimation } from "./animation";
import { FlexConfig } from "../util/flexbox";
export declare function Property(target: Object, propKey: string): void;
export interface IView {
width?: number;
@@ -56,6 +57,11 @@ export interface IView {
* rotation*PI
*/
rotation?: number;
/**----------transform----------*/
/**
* Only affected when its superview or itself is FlexLayout.
*/
flexConfig?: FlexConfig;
}
export declare type NativeViewModel = {
id: string;
@@ -149,6 +155,7 @@ export declare abstract class View implements Modeling, IView {
pivotY?: number;
rotation?: number;
/**----------transform----------*/
flexConfig?: FlexConfig;
doAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
}
export declare abstract class Superview extends View {

View File

@@ -177,7 +177,6 @@ export class View {
getLocationOnScreen(context) {
return this.nativeChannel(context, "getLocationOnScreen")();
}
/**----------transform----------*/
doAnimation(context, animation) {
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
for (let key in args) {
@@ -267,6 +266,10 @@ __decorate([
Property,
__metadata("design:type", Number)
], View.prototype, "rotation", void 0);
__decorate([
Property,
__metadata("design:type", Object)
], View.prototype, "flexConfig", void 0);
export class Superview extends View {
subviewById(id) {
for (let v of this.allSubviews()) {