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);
}
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;
}
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();
}
}
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();
}
});
}
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;
}
Aggregations