use of com.alibaba.fastjson.JSONObject in project ride-read-android by Ride-Read.
the class MsgUtils method addMsgInfo.
public static void addMsgInfo(UserBaseInfo user, String msg, long time) {
JSONObject msgUserJson = getMsgUserObj();
if (null == msgUserJson)
msgUserJson = new JSONObject();
MsgInfo msginfo = new MsgInfo(user, msg, time);
String key = Integer.toString(user.getUid());
if (msgUserJson.containsKey(key))
msgUserJson.remove(key);
msgUserJson.put(key, msginfo);
saveMsgUserList(msgUserJson);
}
use of com.alibaba.fastjson.JSONObject in project ride-read-android by Ride-Read.
the class MsgActivity method refreshMsgUserList.
private void refreshMsgUserList() {
JSONObject msgsJson = MsgUtils.getMsgUserObj();
if (null != msgsJson) {
Set<String> keySet = msgsJson.keySet();
Iterator keyCursor = keySet.iterator();
String key;
mMsgInfoList.clear();
while (keyCursor.hasNext()) {
key = (String) keyCursor.next();
mMsgInfoList.add(msgsJson.getObject(key, MsgInfo.class));
mMsgUserAdapter.notifyDataSetChanged();
}
}
}
use of com.alibaba.fastjson.JSONObject in project weex-example by KalicyZhou.
the class WXComponent method updateStyleByPesudo.
private void updateStyleByPesudo(Map<String, Object> styles) {
Message message = Message.obtain();
WXDomTask task = new WXDomTask();
task.instanceId = getInstanceId();
task.args = new ArrayList<>();
JSONObject styleJson = new JSONObject(styles);
task.args.add(getRef());
task.args.add(styleJson);
//flag pesudo
task.args.add(true);
message.obj = task;
message.what = WXDomHandler.MsgType.WX_DOM_UPDATE_STYLE;
WXSDKManager.getInstance().getWXDomManager().sendMessage(message);
}
use of com.alibaba.fastjson.JSONObject in project weex-example by KalicyZhou.
the class WXDomStatementTest method testRemoveDom.
@Test
public void testRemoveDom() throws Exception {
createBody();
JSONObject obj;
obj = new JSONObject();
obj.put("type", "div");
obj.put("ref", "100");
stmt.addDom(obj, WXDomObject.ROOT, 0);
obj = new JSONObject();
obj.put("type", "div");
obj.put("ref", "101");
stmt.addDom(obj, WXDomObject.ROOT, 0);
stmt.removeDom("101");
stmt.batch();
}
use of com.alibaba.fastjson.JSONObject in project weex-example by KalicyZhou.
the class WXDomStatementTest method createBody.
void createBody() {
JSONObject body = new JSONObject();
body.put("type", "div");
body.put("ref", WXDomObject.ROOT);
stmt.createBody(body);
}
Aggregations