This commit is contained in:
18401019693 2022-07-27 10:12:41 +08:00
parent 69977483d2
commit 8216efaba6
5 changed files with 38 additions and 9 deletions

View File

@ -66,6 +66,15 @@ public class InstructorRemarkManager extends BaseCacheManager {
put(KEY_INSTRUCTOR_REMARK, json); put(KEY_INSTRUCTOR_REMARK, json);
} }
/**
* 删除备注
*/
public void removeInstructorRemark(String key) {
instructorRemarkMap.remove(key);
String json = new Gson().toJson(instructorRemarkMap).toString();
put(KEY_INSTRUCTOR_REMARK, json);
}
/** /**
* 从服务器获取信息 * 从服务器获取信息
*/ */

View File

@ -9,9 +9,9 @@ ext {
] ]
manifestPlaceholders = [ manifestPlaceholders = [
// //
serverHost : "https://napi.yaoulive.com", // serverHost : "https://napi.yaoulive.com",
// //
// serverHost : "https://ceshi.yaoulive.com", serverHost : "https://ceshi.yaoulive.com",
// //
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -52,7 +52,7 @@ public class EditNameRemarksActivity extends AbsActivity implements View.OnClick
}); });
findViewById(R.id.btn_save).setOnClickListener(this); findViewById(R.id.btn_save).setOnClickListener(this);
String content = InstructorRemarkManager.get(mContext).getInstructorRemark().get(userId); String content = InstructorRemarkManager.get(mContext).getInstructorRemark().get(userId);
if (!TextUtils.isEmpty(content)){ if (!TextUtils.isEmpty(content)) {
mEditText.setText(content); mEditText.setText(content);
mEditText.setSelection(content.length()); mEditText.setSelection(content.length());
} }
@ -67,7 +67,23 @@ public class EditNameRemarksActivity extends AbsActivity implements View.OnClick
} }
final String content = mEditText.getText().toString().trim(); final String content = mEditText.getText().toString().trim();
if (TextUtils.isEmpty(content)) { if (TextUtils.isEmpty(content)) {
ToastUtil.show(R.string.edit_profile_name_empty); //获取用户信息
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(userId);
if (null != userInfo && !TextUtils.isEmpty(userInfo.getExtra())) {
SearchUserBean userBean = GsonUtils.fromJson(userInfo.getExtra(), SearchUserBean.class);
LiveHttpUtil.setInstructorRemark(userId, content, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
ToastUtil.show(msg);
if (code == 0) {
InstructorRemarkManager.get(mContext).removeInstructorRemark(userId);
//刷新列表内用户信息
addUserInfoProvider(userBean.getUserNiceName());
}
}
});
}
return; return;
} }

View File

@ -138,6 +138,7 @@ public class ConversationIMListManager {
} else { } else {
userNiceName = userBean.getUserNiceName(); userNiceName = userBean.getUserNiceName();
} }
if (!TextUtils.isEmpty(userNiceName)&&!TextUtils.isEmpty(userBean.getAvatar())){
UserInfo userInfo = new UserInfo(userId, userNiceName, Uri.parse(userBean.getAvatar())); UserInfo userInfo = new UserInfo(userId, userNiceName, Uri.parse(userBean.getAvatar()));
//使用空白字段存储自己服务器用户的所有的信息 //使用空白字段存储自己服务器用户的所有的信息
userInfo.setExtra(GsonUtils.toJson(userBean)); userInfo.setExtra(GsonUtils.toJson(userBean));
@ -145,6 +146,8 @@ public class ConversationIMListManager {
} }
} }
}
}); });
return null; return null;

View File

@ -31,7 +31,8 @@
<FrameLayout <FrameLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:layout_marginBottom="71dp" />
<RelativeLayout <RelativeLayout
android:id="@+id/rt_main_tab" android:id="@+id/rt_main_tab"