Search in sources :

Example 6 with UserInfoVo

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

the class Utils method intentFriendUserInfo.

/**
 * Jump to the personal information page
 */
public static void intentFriendUserInfo(Activity act, UserBaseVo vo, boolean finish) {
    Intent intent = new Intent(act, FriendInfoUI.class);
    UserInfoVo info = new UserInfoVo();
    info.setLocalId(vo.getLocalId());
    info.setMid(vo.getMid());
    info.setUsername(vo.getUserName());
    info.setNote(vo.getNote());
    info.setThumb(vo.getThumb());
    info.setGender(vo.getGender());
    info.setSightml(vo.getSightml());
    info.setAge(vo.getAge());
    info.setFriendLog(vo.getFriendLog());
    info.setOffLineFound(vo.isOffLineFound());
    intent.putExtra("info", info);
    act.startActivity(intent);
    openNewActivityAnim(act, finish);
}
Also used : Intent(android.content.Intent) UserInfoVo(com.lingtuan.firefly.vo.UserInfoVo)

Example 7 with UserInfoVo

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

the class BlackListAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    BlackHolder holder;
    if (convertView == null) {
        holder = new BlackHolder();
        convertView = View.inflate(c, R.layout.black_list_item, null);
        holder.avatar = (ImageView) convertView.findViewById(R.id.invite_avatar);
        holder.nickName = (TextView) convertView.findViewById(R.id.name);
        convertView.setTag(holder);
    } else {
        holder = (BlackHolder) convertView.getTag();
    }
    UserInfoVo vo = source.get(position);
    NextApplication.displayCircleImage(holder.avatar, vo.getThumb());
    holder.nickName.setText(vo.getShowName());
    return convertView;
}
Also used : UserInfoVo(com.lingtuan.firefly.vo.UserInfoVo)

Example 8 with UserInfoVo

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

the class DiscussGroupJoinUI method setContentView.

@Override
protected void setContentView() {
    setContentView(R.layout.discuss_group_join_layout);
    try {
        if (NextApplication.myInfo == null || TextUtils.isEmpty(NextApplication.myInfo.getLocalId())) {
            NextApplication.myInfo = new UserInfoVo().readMyUserInfo(this);
        }
        String s = getIntent().toURI();
        Uri parse = Uri.parse(s);
        String gid = parse.getQueryParameter("gid");
        if (!TextUtils.isEmpty(gid)) {
            cid = gid;
        } else {
            String uid = parse.getQueryParameter("uid");
            UserBaseVo info = new UserBaseVo();
            info.setLocalId(uid);
            if (!TextUtils.isEmpty(uid)) {
                Utils.intentFriendUserInfo(this, info, true);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : Uri(android.net.Uri) UserInfoVo(com.lingtuan.firefly.vo.UserInfoVo) UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 9 with UserInfoVo

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

the class BlackListUI method loadBlackList.

/**
 * Load the data
 */
private void loadBlackList(int page) {
    if (isLoadingData) {
        return;
    }
    isLoadingData = true;
    oldPage = page;
    NetRequestImpl.getInstance().getBlackList(page, new RequestListener() {

        @Override
        public void start() {
        }

        @Override
        public void success(JSONObject response) {
            currentPage = oldPage;
            if (currentPage == 1) {
                source.clear();
            }
            JSONArray jsonArray = response.optJSONArray("data");
            if (jsonArray != null) {
                int count = jsonArray.length();
                for (int i = 0; i < count; i++) {
                    UserInfoVo uInfo = new UserInfoVo().parse(jsonArray.optJSONObject(i));
                    source.add(uInfo);
                }
                blackAdapter.resetSource(source);
            } else {
                showToast(getString(R.string.black_list_empty));
            }
            isLoadingData = false;
            swipeLayout.setRefreshing(false);
            if (jsonArray != null && jsonArray.length() >= 10) {
                blackLv.resetFooterState(true);
            } else {
                blackLv.resetFooterState(false);
            }
            checkListEmpty();
        }

        @Override
        public void error(int errorCode, String errorMsg) {
            isLoadingData = false;
            swipeLayout.setRefreshing(false);
            showToast(errorMsg);
            checkListEmpty();
        }
    });
}
Also used : RequestListener(com.lingtuan.firefly.listener.RequestListener) JSONObject(org.json.JSONObject) JSONArray(org.json.JSONArray) UserInfoVo(com.lingtuan.firefly.vo.UserInfoVo)

Example 10 with UserInfoVo

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

the class LoginUtil method intoMainUI.

/**
 * enter MainUI
 * @ param mName user name
 * @ param mPwd password
 */
public boolean intoMainUI(Context context, String mName, String mPwd) {
    ArrayList<UserInfoVo> infoList = JsonUtil.readLocalInfo(context);
    for (int i = 0; i < infoList.size(); i++) {
        String username = infoList.get(i).getUsername();
        String mid = infoList.get(i).getMid();
        String password = infoList.get(i).getPassword();
        if ((TextUtils.equals(mName, username) || TextUtils.equals(mName, mid)) && TextUtils.equals(mPwd, password)) {
            // Save the current user information
            String jsonString = MySharedPrefs.readString(mContext, MySharedPrefs.FILE_USER, infoList.get(i).getLocalId());
            try {
                JSONObject object = new JSONObject(jsonString);
                MySharedPrefs.write(mContext, MySharedPrefs.FILE_USER, MySharedPrefs.KEY_LOGIN_USERINFO, object.optString(infoList.get(i).getLocalId()));
            } catch (JSONException e) {
                e.printStackTrace();
            }
            NextApplication.myInfo = new UserInfoVo().readMyUserInfo(context);
            FinalUserDataBase.getInstance().close();
            XmppUtils.loginXmppForNextApp(context);
            MySharedPrefs.write(context, MySharedPrefs.FILE_USER, MySharedPrefs.IS_FIRST_LOGIN, "yes");
            context.startActivity(new Intent(context, MainFragmentUI.class));
            Utils.openNewActivityAnim((Activity) context, true);
            // Close the guide page
            Intent intent = new Intent(Constants.ACTION_CLOSE_GUID);
            Utils.sendBroadcastReceiver(mContext, intent, true);
            return true;
        }
    }
    MyToast.showToast(context, context.getString(R.string.login_pwd_error));
    return false;
}
Also used : JSONObject(org.json.JSONObject) JSONException(org.json.JSONException) Intent(android.content.Intent) UserInfoVo(com.lingtuan.firefly.vo.UserInfoVo) MainFragmentUI(com.lingtuan.firefly.ui.MainFragmentUI)

Aggregations

UserInfoVo (com.lingtuan.firefly.vo.UserInfoVo)16 JSONObject (org.json.JSONObject)8 JSONException (org.json.JSONException)6 JSONArray (org.json.JSONArray)5 Intent (android.content.Intent)4 RequestListener (com.lingtuan.firefly.listener.RequestListener)4 MainFragmentUI (com.lingtuan.firefly.ui.MainFragmentUI)2 SuppressLint (android.annotation.SuppressLint)1 Configuration (android.content.res.Configuration)1 Resources (android.content.res.Resources)1 Uri (android.net.Uri)1 Handler (android.os.Handler)1 NearByPeopleAdapter (com.lingtuan.firefly.adapter.NearByPeopleAdapter)1 CrashHandler (com.lingtuan.firefly.util.CrashHandler)1 UserBaseVo (com.lingtuan.firefly.vo.UserBaseVo)1 ImageLoaderConfiguration (com.nostra13.universalimageloader.core.ImageLoaderConfiguration)1 ArrayList (java.util.ArrayList)1