diff --git a/Android/doric/src/main/java/pub/doric/shader/ViewNode.java b/Android/doric/src/main/java/pub/doric/shader/ViewNode.java index 0b08bab7..7ed2d98b 100644 --- a/Android/doric/src/main/java/pub/doric/shader/ViewNode.java +++ b/Android/doric/src/main/java/pub/doric/shader/ViewNode.java @@ -56,6 +56,10 @@ public abstract class ViewNode extends DoricContextHolder { mSuperNode = parentNode; } + public void setId(String id) { + this.mId = id; + } + public View getDoricLayer() { return doricLayer; } diff --git a/Android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java b/Android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java index 88b3cd8f..54dfd9ac 100644 --- a/Android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java +++ b/Android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java @@ -58,6 +58,7 @@ public class ListAdapter extends RecyclerView.Adapter { it.gravity = gravity().center() - it.bgColor = Color.parse("#fff00f") + it.bgColor = Color.parse(colors[idx % colors.length]) it.layoutConfig = { widthSpec: LayoutSpec.AT_MOST, - heightSpec: LayoutSpec.WRAP_CONTENT, + heightSpec: LayoutSpec.EXACTLY, + } + it.height = 50 + it.onClick = () => { + log(`Click item at ${idx}`) } }) } diff --git a/js-framework/src/runtime/sandbox.ts b/js-framework/src/runtime/sandbox.ts index 9f488166..4e2c74d9 100644 --- a/js-framework/src/runtime/sandbox.ts +++ b/js-framework/src/runtime/sandbox.ts @@ -230,7 +230,6 @@ export function jsCallEntityMethod(contextId: string, methodName: string, args?: hookBeforeNativeCall(context) const ret = Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList) hookAfterNativeCall(context) - loge(methodName, ret) return ret } else { loge(`Cannot find method for context id:${contextId},method name is:${methodName}`) diff --git a/js-framework/src/ui/listview.ts b/js-framework/src/ui/listview.ts index dc8d190e..1ea2d0c1 100644 --- a/js-framework/src/ui/listview.ts +++ b/js-framework/src/ui/listview.ts @@ -18,6 +18,7 @@ import { View, Property, LayoutSpec, Superview } from "./view"; import { Model } from "../util/types"; import { O_TRUNC } from "constants"; import { Stack } from "./layout"; +import { loge } from "../util/log"; export function listItem(item: View) { return (new ListItem).also((it) => { it.layoutConfig = {