Search in sources :

Example 1 with CellRenderContext

use of com.taobao.weex.ui.component.list.template.CellRenderContext in project incubator-weex by apache.

the class StatementTest method createContext.

private CellRenderContext createContext(int count) {
    JSONObject data = new JSONObject();
    data.put("item", new JSONObject());
    data.getJSONObject("item").put("name", "hello world");
    List<String> datas = new ArrayList<>();
    for (int i = 0; i < count; i++) {
        datas.add("hello" + count);
    }
    data.getJSONObject("item").put("list", datas);
    data.put("dataList", datas);
    ArrayStack context = new ArrayStack();
    context.push(data);
    CellRenderContext cellRenderContext = new CellRenderContext();
    cellRenderContext.stack = context;
    return cellRenderContext;
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) ArrayList(java.util.ArrayList) CellRenderContext(com.taobao.weex.ui.component.list.template.CellRenderContext) ArrayStack(com.taobao.weex.el.parse.ArrayStack)

Aggregations

JSONObject (com.alibaba.fastjson.JSONObject)1 ArrayStack (com.taobao.weex.el.parse.ArrayStack)1 CellRenderContext (com.taobao.weex.ui.component.list.template.CellRenderContext)1 ArrayList (java.util.ArrayList)1