Search in sources :

Example 6 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class MsgAddContactListUI method onItemClick.

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    UserBaseVo info = new UserBaseVo();
    info.setLocalId(mList.get(position).getUserId());
    info.setUsername(mList.get(position).getUsername());
    info.setThumb(mList.get(position).getUserImage());
    Utils.intentFriendUserInfo(this, info, false);
}
Also used : UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 7 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class GroupQuickMarkUI method setDiscussAvatar.

/**
 * set group avatar
 */
private void setDiscussAvatar() {
    mGroupAvatar.setVisibility(View.VISIBLE);
    String[] split = avatarUrl.split("#");
    UserBaseVo vo;
    for (int i = 0; i < split.length; i++) {
        vo = new UserBaseVo();
        String[] splitVo = split[i].split("___");
        String gender = "2";
        try {
            gender = splitVo[1];
        } catch (Exception e) {
            e.printStackTrace();
        }
        String avatar = "";
        try {
            avatar = splitVo[0];
        } catch (Exception e) {
            e.printStackTrace();
        }
        vo.setGender(gender);
        vo.setThumb(avatar);
        avatarList.add(vo);
    }
    mGroupAvatar.setMember(avatarList);
}
Also used : SuppressLint(android.annotation.SuppressLint) WriterException(com.google.zxing.WriterException) UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 8 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class Utils method gotoGroupChat.

/**
 * into the group chat
 * @ param cid group chat id
 * @ param member group of members
 */
public static void gotoGroupChat(Context context, boolean hasJoined, String groupName, String cid, List<UserBaseVo> member) {
    StringBuilder url = new StringBuilder();
    StringBuilder username = new StringBuilder();
    try {
        if (!hasJoined) {
            url.append(NextApplication.myInfo.getThumb()).append("___").append(NextApplication.myInfo.getGender()).append("#");
        }
        for (UserBaseVo vo : member) {
            url.append(vo.getThumb()).append("___").append(vo.getGender()).append("#");
        }
        url.deleteCharAt(url.lastIndexOf("#"));
        if (TextUtils.isEmpty(groupName)) {
            username.append(NextApplication.myInfo.getUserName()).append("、");
            for (UserBaseVo vo : member) {
                username.append(vo.getUserName()).append("、");
            }
            username.deleteCharAt(username.lastIndexOf("、"));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    Utils.intentChattingUI(context, "group-" + cid, url.toString(), TextUtils.isEmpty(groupName) ? username.toString() : groupName, "1", 0, true, false, false, 0, true);
}
Also used : IOException(java.io.IOException) UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 9 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class FriendInfoUI method loadData.

/**
 * Loading the page information
 */
private void loadData() {
    if (info != null) {
        UserBaseVo vo = FinalUserDataBase.getInstance().getUserBaseVoByUid(info.getLocalId());
        if (vo != null) {
            info.setFriendLog(1);
        } else if (TextUtils.equals(NextApplication.myInfo.getLocalId(), info.getLocalId())) {
            info.setFriendLog(-1);
        }
        setTitle(info.getUsername());
        if (!info.getThumb().startsWith("http:")) {
            friendImg.setText(info.getUsername(), friendImg, "file://".concat(info.getThumb()));
        } else {
            friendImg.setText(info.getUsername(), friendImg, info.getThumb());
        }
        if (TextUtils.isEmpty(info.getNote())) {
            friendNote.setVisibility(View.INVISIBLE);
        } else {
            friendNote.setVisibility(View.VISIBLE);
            friendNote.setText(info.getNote());
        }
        if (TextUtils.isEmpty(info.getMid())) {
            friendMid.setVisibility(View.INVISIBLE);
        } else {
            friendMid.setVisibility(View.VISIBLE);
            friendMid.setText(getString(R.string.mid_user, info.getMid()));
        }
        friendSignature.setText(info.getSightml());
        if (info.getFriendLog() == -1) {
            app_right.setVisibility(View.GONE);
            addFriends.setVisibility(View.GONE);
            sendMsg.setVisibility(View.GONE);
        } else if (info.getFriendLog() == 1) {
            addFriends.setText(getString(R.string.contact_default));
            addFriends.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.icon_has_friend), null, null, null);
            addFriends.setEnabled(false);
            if (Utils.isConnectNet(FriendInfoUI.this)) {
                app_right.setVisibility(View.VISIBLE);
            } else {
                app_right.setVisibility(View.GONE);
            }
        } else {
            addFriends.setEnabled(true);
            addFriends.setText(getString(R.string.add_friends));
            addFriends.setTextColor(getResources().getColor(R.color.black));
            addFriends.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.icon_info_add_friend), null, null, null);
            if (Utils.isConnectNet(FriendInfoUI.this)) {
                app_right.setVisibility(View.VISIBLE);
            } else {
                app_right.setVisibility(View.GONE);
            }
        }
    }
}
Also used : UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 10 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class ChattingSetUI method onClick.

@Override
public void onClick(View v) {
    super.onClick(v);
    switch(v.getId()) {
        case // The personal data
        R.id.chatUserInfo:
            UserBaseVo info = new UserBaseVo();
            info.setLocalId(uid);
            info.setUsername(userName);
            info.setGender(gender);
            info.setThumb(avatarUrl);
            Utils.intentFriendUserInfo(this, info, false);
            break;
        case // Chat to report
        R.id.chatInfoReport:
            Intent report = new Intent(ChattingSetUI.this, ChatReportReasonUI.class);
            report.putExtra("buid", uid);
            report.putExtra("avatarurl", avatarUrl);
            report.putExtra("username", userName);
            report.putExtra("gender", gender);
            startActivityForResult(report, CHOICE_REASON_REQUEST_CODE);
            Utils.openNewActivityAnim(ChattingSetUI.this, false);
            break;
        default:
            break;
    }
}
Also used : Intent(android.content.Intent) UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Aggregations

UserBaseVo (com.lingtuan.firefly.vo.UserBaseVo)53 ArrayList (java.util.ArrayList)13 ChatMsg (com.lingtuan.firefly.vo.ChatMsg)9 Cursor (android.database.Cursor)7 View (android.view.View)7 ListView (android.widget.ListView)7 TextView (android.widget.TextView)7 Intent (android.content.Intent)6 ImageView (android.widget.ImageView)6 JSONObject (org.json.JSONObject)6 Bundle (android.os.Bundle)5 AdapterView (android.widget.AdapterView)5 OnClickListener (android.view.View.OnClickListener)4 HorizontalScrollView (android.widget.HorizontalScrollView)4 DiscussionGroupsVo (com.lingtuan.firefly.contact.vo.DiscussionGroupsVo)4 NewContactVO (com.lingtuan.firefly.contact.vo.NewContactVO)4 RequestListener (com.lingtuan.firefly.listener.RequestListener)4 Handler (android.os.Handler)3 Editable (android.text.Editable)3 LinearLayout (android.widget.LinearLayout)3