Search in sources :

Example 21 with User

use of com.juns.wechat.bean.User in project wechat by motianhuo.

the class MyCodeActivity method initData.

@Override
protected void initData() {
    String id = Utils.getValue(this, Constants.User_ID);
    tv_accout.setText("微信号:" + id);
    User user = GloableParams.Users.get(id);
    if (user != null && !TextUtils.isEmpty(user.getUserName()))
        tvname.setText(user.getUserName());
    Bitmap qrcode = generateQRCode("JUNS_WeChat@User:" + id);
    ImageView imageView = (ImageView) findViewById(R.id.img_code);
    imageView.setImageBitmap(qrcode);
}
Also used : Bitmap(android.graphics.Bitmap) User(com.juns.wechat.bean.User) ImageView(android.widget.ImageView)

Example 22 with User

use of com.juns.wechat.bean.User in project wechat by motianhuo.

the class UpdateService method initUserList.

// 获取好友列表和订阅号
private void initUserList() {
    GloableParams.UserInfos = db.findAll(User.class);
    netClient.post(Constants.getUserInfoURL, null, new BaseJsonRes() {

        @Override
        public void onMySuccess(String data) {
            List<User> new_users = JSON.parseArray(data, User.class);
            for (User user : new_users) {
                if (user.getUserName() == null) {
                    user.setUserName("WX" + user.getTelephone());
                    new_users.remove(user);
                    new_users.add(user);
                }
                if (db.findById(user.getId(), User.class) != null)
                    db.deleteById(User.class, user.getId());
                db.save(user);
                GloableParams.Users.put(user.getTelephone(), user);
            }
            sendBrodcast("UserList");
        }

        @Override
        public void onMyFailure() {
        // initUserList();
        }
    });
}
Also used : User(com.juns.wechat.bean.User) List(java.util.List) BaseJsonRes(com.juns.wechat.net.BaseJsonRes)

Example 23 with User

use of com.juns.wechat.bean.User in project wechat by motianhuo.

the class AddFromContactActivity method initView.

@Override
protected void initView() {
    getLoadingDialog("正在获取联系人").show();
    String str_contact = Utils.getValue(this, Constants.ContactMsg);
    RequestParams params = new RequestParams();
    params.put("userlist", str_contact);
    netClient.post(Constants.getContactFriendURL, params, new BaseJsonRes() {

        @Override
        public void onMySuccess(String data) {
            List<User> UserInfos = JSON.parseArray(data, User.class);
            mlistview.setAdapter(new FromContactAdapter(AddFromContactActivity.this, UserInfos));
            getLoadingDialog("正在获取联系人").dismiss();
        }

        @Override
        public void onMyFailure() {
            // TODO Auto-generated method stub
            getLoadingDialog("正在获取联系人").dismiss();
        }
    });
}
Also used : User(com.juns.wechat.bean.User) FromContactAdapter(com.juns.wechat.adpter.FromContactAdapter) List(java.util.List) RequestParams(com.juns.health.net.loopj.android.http.RequestParams) BaseJsonRes(com.juns.wechat.net.BaseJsonRes)

Aggregations

User (com.juns.wechat.bean.User)23 Intent (android.content.Intent)5 ImageView (android.widget.ImageView)5 GroupInfo (com.juns.wechat.bean.GroupInfo)5 TextView (android.widget.TextView)4 FinalDb (net.tsz.afinal.FinalDb)4 View (android.view.View)3 OnClickListener (android.view.View.OnClickListener)3 EaseMobException (com.easemob.exceptions.EaseMobException)3 BaseJsonRes (com.juns.wechat.net.BaseJsonRes)3 List (java.util.List)3 EMConversation (com.easemob.chat.EMConversation)2 RequestParams (com.juns.health.net.loopj.android.http.RequestParams)2 FriendMsgActivity (com.juns.wechat.view.activity.FriendMsgActivity)2 Bitmap (android.graphics.Bitmap)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 EMGroup (com.easemob.chat.EMGroup)1 EMMessage (com.easemob.chat.EMMessage)1 ImageMessageBody (com.easemob.chat.ImageMessageBody)1