|
@@ -16,13 +16,13 @@ import android.widget.RadioGroup;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
+import androidx.appcompat.widget.Toolbar;
|
|
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
|
|
import com.alibaba.android.arouter.launcher.ARouter;
|
|
|
-import com.common.im.bean.ContactRoomListBean;
|
|
|
import com.cooleshow.base.router.RouterPath;
|
|
|
import com.cooleshow.base.ui.activity.BaseMVPActivity;
|
|
|
import com.cooleshow.base.ui.video.VideoPlayActivity;
|
|
@@ -39,6 +39,7 @@ import com.cooleshow.base.utils.UiUtils;
|
|
|
import com.cooleshow.base.widgets.CommonItemDecoration;
|
|
|
import com.cooleshow.base.widgets.EmptyViewLayout;
|
|
|
import com.cooleshow.base.widgets.dialog.CommonDialog;
|
|
|
+import com.cooleshow.chatmodule.bean.ContactRoomListBean;
|
|
|
import com.cooleshow.teacher.R;
|
|
|
import com.cooleshow.teacher.adapter.MineStyleFansGroupListAdapter;
|
|
|
import com.cooleshow.teacher.adapter.MineStyleVideoAdapter;
|
|
@@ -109,92 +110,76 @@ public class MineStylePageActivity extends BaseMVPActivity<ActivityMineStylePage
|
|
|
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
- switch (view.getId()) {
|
|
|
- case R.id.tv_select_fans:
|
|
|
- isModify = true;
|
|
|
- Bundle bundle = new Bundle();
|
|
|
- bundle.putSerializable("selectTeachableInstrument", (Serializable) selectTeachableInstrument);
|
|
|
- ARouter.getInstance().build(RouterPath.MineCenter.MINE_TEACHABLE_INSTRUMENT)
|
|
|
- .withBundle("bundle", bundle)
|
|
|
- .navigation(this, SELECT_RESULT);
|
|
|
- break;
|
|
|
- case com.cooleshow.base.R.id.tv_right_text:
|
|
|
- case R.id.tv_save:
|
|
|
- myStyleInfoBean.styleVideo.clear();
|
|
|
- for (TeacherSelfStyleInfoBean.StyleVideoBean styleVideoBean : videoBeanList) {
|
|
|
- if (styleVideoBean.type != 1) {
|
|
|
- if (TextUtils.isEmpty(styleVideoBean.cover)) {
|
|
|
- ToastUtil.getInstance().showShort("请上传个人风采视频封面");
|
|
|
- return;
|
|
|
- }
|
|
|
- myStyleInfoBean.styleVideo.add(styleVideoBean);
|
|
|
+ int id = view.getId();
|
|
|
+ if (id == R.id.tv_select_fans) {
|
|
|
+ isModify = true;
|
|
|
+ Bundle bundle = new Bundle();
|
|
|
+ bundle.putSerializable("selectTeachableInstrument", (Serializable) selectTeachableInstrument);
|
|
|
+ ARouter.getInstance().build(RouterPath.MineCenter.MINE_TEACHABLE_INSTRUMENT)
|
|
|
+ .withBundle("bundle", bundle)
|
|
|
+ .navigation(this, SELECT_RESULT);
|
|
|
+ } else if (id == com.cooleshow.base.R.id.tv_right_text || id == R.id.tv_save) {
|
|
|
+ myStyleInfoBean.styleVideo.clear();
|
|
|
+ for (TeacherSelfStyleInfoBean.StyleVideoBean styleVideoBean : videoBeanList) {
|
|
|
+ if (styleVideoBean.type != 1) {
|
|
|
+ if (TextUtils.isEmpty(styleVideoBean.cover)) {
|
|
|
+ ToastUtil.getInstance().showShort("请上传个人风采视频封面");
|
|
|
+ return;
|
|
|
}
|
|
|
+ myStyleInfoBean.styleVideo.add(styleVideoBean);
|
|
|
}
|
|
|
- myStyleInfoBean.introduction = etSelfIntroduction.getText().toString().trim();
|
|
|
- String subjectIdStr = "";
|
|
|
- String subjectNameStr = "";
|
|
|
- for (TeachableInstrumentBean teachableInstrumentBean : selectTeachableInstrument) {
|
|
|
- subjectIdStr += "," + teachableInstrumentBean.id;
|
|
|
- subjectNameStr += "," + teachableInstrumentBean.name;
|
|
|
- }
|
|
|
- if (subjectIdStr.startsWith(",")) {
|
|
|
- subjectIdStr = subjectIdStr.replaceFirst(",", "");
|
|
|
- }
|
|
|
- if (subjectNameStr.startsWith(",")) {
|
|
|
- subjectNameStr = subjectNameStr.replaceFirst(",", "");
|
|
|
- }
|
|
|
- myStyleInfoBean.subjectId = subjectIdStr;
|
|
|
- myStyleInfoBean.subjectName = subjectNameStr;
|
|
|
- presenter.saveTeacherStyle(GsonUtils.toJson(myStyleInfoBean));
|
|
|
- break;
|
|
|
- case R.id.tv_add_style:
|
|
|
- getVideoPermission();
|
|
|
- break;
|
|
|
- case R.id.iv_avatar:
|
|
|
- selectHeader();
|
|
|
- break;
|
|
|
- case R.id.view_nick_click:
|
|
|
- //昵称修改
|
|
|
- if (!TextUtils.isEmpty(currentNickName)) {
|
|
|
- ARouter.getInstance().build(RouterPath.MineCenter.MINE_MODIFY_NICKNAME)
|
|
|
- .withString("userName", currentNickName)
|
|
|
- .navigation(this);
|
|
|
- }
|
|
|
- break;
|
|
|
- case R.id.view_real_name_click:
|
|
|
- //实名认证
|
|
|
- if (!TextUtils.isEmpty(isReal) && TextUtils.equals(isReal, "0")) {
|
|
|
- ARouter.getInstance().build(RouterPath.MineCenter.MINE_PERSONAL_CERTIFICATION)
|
|
|
- .navigation(this);
|
|
|
- }
|
|
|
- break;
|
|
|
- case R.id.view_phone_click:
|
|
|
- //手机号
|
|
|
- ARouter.getInstance().build(RouterPath.MineCenter.MINE_CHECK_MODIFY_PHONENUM)
|
|
|
+ }
|
|
|
+ myStyleInfoBean.introduction = etSelfIntroduction.getText().toString().trim();
|
|
|
+ String subjectIdStr = "";
|
|
|
+ String subjectNameStr = "";
|
|
|
+ for (TeachableInstrumentBean teachableInstrumentBean : selectTeachableInstrument) {
|
|
|
+ subjectIdStr += "," + teachableInstrumentBean.id;
|
|
|
+ subjectNameStr += "," + teachableInstrumentBean.name;
|
|
|
+ }
|
|
|
+ if (subjectIdStr.startsWith(",")) {
|
|
|
+ subjectIdStr = subjectIdStr.replaceFirst(",", "");
|
|
|
+ }
|
|
|
+ if (subjectNameStr.startsWith(",")) {
|
|
|
+ subjectNameStr = subjectNameStr.replaceFirst(",", "");
|
|
|
+ }
|
|
|
+ myStyleInfoBean.subjectId = subjectIdStr;
|
|
|
+ myStyleInfoBean.subjectName = subjectNameStr;
|
|
|
+ presenter.saveTeacherStyle(GsonUtils.toJson(myStyleInfoBean));
|
|
|
+ } else if (id == R.id.tv_add_style) {
|
|
|
+ getVideoPermission();
|
|
|
+ } else if (id == R.id.iv_avatar) {
|
|
|
+ selectHeader();
|
|
|
+ } else if (id == R.id.view_nick_click) {//昵称修改
|
|
|
+ if (!TextUtils.isEmpty(currentNickName)) {
|
|
|
+ ARouter.getInstance().build(RouterPath.MineCenter.MINE_MODIFY_NICKNAME)
|
|
|
+ .withString("userName", currentNickName)
|
|
|
.navigation(this);
|
|
|
- break;
|
|
|
- case R.id.tv_edit_introduce:
|
|
|
- //编辑个人介绍
|
|
|
- isModify = true;
|
|
|
- SoftKeyboardUtils.showSoftKeyboard(viewBinding.etSelfIntroduction);
|
|
|
- if (!TextUtils.isEmpty(viewBinding.etSelfIntroduction.getText())) {
|
|
|
- int length = viewBinding.etSelfIntroduction.getText().length();
|
|
|
- viewBinding.etSelfIntroduction.setSelection(length);
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- case R.id.tv_male:
|
|
|
- if (TextUtils.equals(currentGander, GENDER_TYPE_MALE)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- modifySex(true);
|
|
|
- break;
|
|
|
- case R.id.tv_female:
|
|
|
- if (TextUtils.equals(currentGander, GENDER_TYPE_FEMALE)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- modifySex(false);
|
|
|
- break;
|
|
|
+ }
|
|
|
+ } else if (id == R.id.view_real_name_click) {//实名认证
|
|
|
+ if (!TextUtils.isEmpty(isReal) && TextUtils.equals(isReal, "0")) {
|
|
|
+ ARouter.getInstance().build(RouterPath.MineCenter.MINE_PERSONAL_CERTIFICATION)
|
|
|
+ .navigation(this);
|
|
|
+ }
|
|
|
+ } else if (id == R.id.view_phone_click) {//手机号
|
|
|
+ ARouter.getInstance().build(RouterPath.MineCenter.MINE_CHECK_MODIFY_PHONENUM)
|
|
|
+ .navigation(this);
|
|
|
+ } else if (id == R.id.tv_edit_introduce) {//编辑个人介绍
|
|
|
+ isModify = true;
|
|
|
+ SoftKeyboardUtils.showSoftKeyboard(viewBinding.etSelfIntroduction);
|
|
|
+ if (!TextUtils.isEmpty(viewBinding.etSelfIntroduction.getText())) {
|
|
|
+ int length = viewBinding.etSelfIntroduction.getText().length();
|
|
|
+ viewBinding.etSelfIntroduction.setSelection(length);
|
|
|
+ }
|
|
|
+ } else if (id == R.id.tv_male) {
|
|
|
+ if (TextUtils.equals(currentGander, GENDER_TYPE_MALE)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ modifySex(true);
|
|
|
+ } else if (id == R.id.tv_female) {
|
|
|
+ if (TextUtils.equals(currentGander, GENDER_TYPE_FEMALE)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ modifySex(false);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -236,6 +221,10 @@ public class MineStylePageActivity extends BaseMVPActivity<ActivityMineStylePage
|
|
|
viewBinding.toolbarInclude.tvRightText.setBackgroundResource(com.cooleshow.base.R.drawable.shape_2dc7aa_14dp);
|
|
|
viewBinding.toolbarInclude.tvRightText.setGravity(Gravity.CENTER);
|
|
|
viewBinding.toolbarInclude.tvRightText.setPadding(SizeUtils.dp2px(12), SizeUtils.dp2px(4), SizeUtils.dp2px(12), SizeUtils.dp2px(4));
|
|
|
+ Toolbar.LayoutParams layoutParams = (Toolbar.LayoutParams) viewBinding.toolbarInclude.tvRightText.getLayoutParams();
|
|
|
+ layoutParams.setMargins(0,0,SizeUtils.dp2px(14),0);
|
|
|
+ viewBinding.toolbarInclude.tvRightText.setLayoutParams(layoutParams);
|
|
|
+
|
|
|
etSelfIntroduction = viewBinding.etSelfIntroduction;
|
|
|
videoList = viewBinding.rvTeacherStyleVideo;
|
|
|
viewBinding.toolbarInclude.tvRightText.setOnClickListener(this);
|