From 3f4b336205fbbf30c30d63c9bf1ffea6fa39b0be Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Sat, 16 Nov 2019 16:09:24 +0800 Subject: [PATCH] feat:delete gravity in Stack --- .../doric/src/main/java/pub/doric/shader/StackNode.java | 8 +------- .../src/main/java/pub/doric/shader/list/ListItemNode.java | 8 ++++++++ iOS/Pod/Classes/Shader/DoricStackNode.m | 6 +----- js-framework/src/ui/layout.ts | 3 --- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Android/doric/src/main/java/pub/doric/shader/StackNode.java b/Android/doric/src/main/java/pub/doric/shader/StackNode.java index f57acf7f..4e235a75 100644 --- a/Android/doric/src/main/java/pub/doric/shader/StackNode.java +++ b/Android/doric/src/main/java/pub/doric/shader/StackNode.java @@ -51,13 +51,7 @@ public class StackNode extends GroupNode { @Override protected void blend(FrameLayout view, String name, JSValue prop) { - switch (name) { - case "gravity": - view.setForegroundGravity(prop.asNumber().toInt()); - break; - default: - super.blend(view, name, prop); - } + super.blend(view, name, prop); } @Override diff --git a/Android/doric/src/main/java/pub/doric/shader/list/ListItemNode.java b/Android/doric/src/main/java/pub/doric/shader/list/ListItemNode.java index 8ce9fcf6..4aabf847 100644 --- a/Android/doric/src/main/java/pub/doric/shader/list/ListItemNode.java +++ b/Android/doric/src/main/java/pub/doric/shader/list/ListItemNode.java @@ -17,6 +17,7 @@ package pub.doric.shader.list; import android.widget.FrameLayout; +import com.github.pengfeizhou.jscore.JSObject; import com.github.pengfeizhou.jscore.JSValue; import pub.doric.DoricContext; @@ -45,4 +46,11 @@ public class ListItemNode extends StackNode { super.blend(view, name, prop); } } + + @Override + public void blend(JSObject jsObject) { + super.blend(jsObject); + getDoricLayer().getLayoutParams().width = getLayoutParams().width; + getDoricLayer().getLayoutParams().height = getLayoutParams().height; + } } diff --git a/iOS/Pod/Classes/Shader/DoricStackNode.m b/iOS/Pod/Classes/Shader/DoricStackNode.m index 9e2f7569..7b0ea338 100644 --- a/iOS/Pod/Classes/Shader/DoricStackNode.m +++ b/iOS/Pod/Classes/Shader/DoricStackNode.m @@ -29,10 +29,6 @@ - (DoricStackView *)build { } - (void)blendView:(DoricStackView *)view forPropName:(NSString *)name propValue:(id)prop { - if ([name isEqualToString:@"gravity"]) { - view.gravity = (DoricGravity) [(NSNumber *) prop integerValue]; - } else { - [super blendView:view forPropName:name propValue:prop]; - } + [super blendView:view forPropName:name propValue:prop]; } @end diff --git a/js-framework/src/ui/layout.ts b/js-framework/src/ui/layout.ts index bfeb246a..0dd19eac 100644 --- a/js-framework/src/ui/layout.ts +++ b/js-framework/src/ui/layout.ts @@ -17,12 +17,9 @@ import { LayoutConfig, Group, Property, IView } from "./view"; import { Gravity } from "../util/gravity"; export interface IStack extends IView { - gravity?: Gravity } export class Stack extends Group implements IStack { - @Property - gravity?: Gravity }