feat:delete gravity in Stack
This commit is contained in:
parent
009c723bc8
commit
3f4b336205
@ -51,13 +51,7 @@ public class StackNode extends GroupNode<FrameLayout> {
|
||||
|
||||
@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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user