[Modify]完善标签功能
This commit is contained in:
@@ -964,7 +964,7 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.user.activity.EditUserTagActivity"
|
android:name=".ui.user.activity.EditUserLabelActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
@@ -13,6 +13,7 @@ import com.yizhuan.erban.audio.SoundSignatureActivity;
|
|||||||
import com.yizhuan.erban.ui.login.AddUserInfoActivity;
|
import com.yizhuan.erban.ui.login.AddUserInfoActivity;
|
||||||
import com.yizhuan.erban.ui.login.ModifyInfoActivity;
|
import com.yizhuan.erban.ui.login.ModifyInfoActivity;
|
||||||
import com.yizhuan.erban.ui.setting.SettingActivity;
|
import com.yizhuan.erban.ui.setting.SettingActivity;
|
||||||
|
import com.yizhuan.erban.ui.user.activity.EditUserLabelActivity;
|
||||||
import com.yizhuan.erban.ui.user.activity.UserInfoActivity;
|
import com.yizhuan.erban.ui.user.activity.UserInfoActivity;
|
||||||
import com.yizhuan.erban.ui.user.activity.UserInfoModifyActivity;
|
import com.yizhuan.erban.ui.user.activity.UserInfoModifyActivity;
|
||||||
import com.yizhuan.erban.ui.user.activity.UserModifyPhotosActivity;
|
import com.yizhuan.erban.ui.user.activity.UserModifyPhotosActivity;
|
||||||
@@ -146,6 +147,11 @@ public class UIHelper {
|
|||||||
"/peko/modules/monster/index.html?monsterId=" + monsterId);
|
"/peko/modules/monster/index.html?monsterId=" + monsterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void showLabelInfoAct(Activity mActivity, int requestCode) {
|
||||||
|
Intent intent = new Intent(mActivity, EditUserLabelActivity.class);
|
||||||
|
mActivity.startActivityForResult(intent, requestCode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转到举报页
|
* 跳转到举报页
|
||||||
*
|
*
|
||||||
|
@@ -18,7 +18,7 @@ import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
|||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||||
import com.yizhuan.erban.base.TitleBar
|
import com.yizhuan.erban.base.TitleBar
|
||||||
import com.yizhuan.erban.databinding.ActivityEditUserTagBinding
|
import com.yizhuan.erban.databinding.ActivityEditUserLabelBinding
|
||||||
import com.yizhuan.erban.ui.user.adapter.CommonWrapIndicatorAdapter
|
import com.yizhuan.erban.ui.user.adapter.CommonWrapIndicatorAdapter
|
||||||
import com.yizhuan.erban.ui.user.adapter.MyUserLabelAdapter
|
import com.yizhuan.erban.ui.user.adapter.MyUserLabelAdapter
|
||||||
import com.yizhuan.erban.ui.user.event.LabelEvent
|
import com.yizhuan.erban.ui.user.event.LabelEvent
|
||||||
@@ -43,15 +43,17 @@ import java.io.Serializable
|
|||||||
* time: 2022/2/16
|
* time: 2022/2/16
|
||||||
* desc: 编辑用户标签
|
* desc: 编辑用户标签
|
||||||
*/
|
*/
|
||||||
class EditUserTagActivity : BaseViewBindingActivity<ActivityEditUserTagBinding>(),
|
class EditUserLabelActivity : BaseViewBindingActivity<ActivityEditUserLabelBinding>(),
|
||||||
CommonWrapIndicatorAdapter.OnItemSelectListener {
|
CommonWrapIndicatorAdapter.OnItemSelectListener {
|
||||||
|
|
||||||
private var userLabelInfo: UserLabelInfo? = null
|
private var userLabelInfo: UserLabelInfo? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
const val KEY_LABEL = "key_label"
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun start(context: Context) {
|
fun start(context: Context) {
|
||||||
val starter = Intent(context, EditUserTagActivity::class.java)
|
val starter = Intent(context, EditUserLabelActivity::class.java)
|
||||||
context.startActivity(starter)
|
context.startActivity(starter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +74,7 @@ class EditUserTagActivity : BaseViewBindingActivity<ActivityEditUserTagBinding>(
|
|||||||
override fun performAction(view: View) {
|
override fun performAction(view: View) {
|
||||||
val list = mMyLabelAdapter.data.joinToString(",")
|
val list = mMyLabelAdapter.data.joinToString(",")
|
||||||
dialogManager.showProgressDialog(
|
dialogManager.showProgressDialog(
|
||||||
this@EditUserTagActivity,
|
this@EditUserLabelActivity,
|
||||||
ResUtil.getString(R.string.ui_user_userinfomodifyactivity_02)
|
ResUtil.getString(R.string.ui_user_userinfomodifyactivity_02)
|
||||||
)
|
)
|
||||||
UserModel.get().saveLabel(list).subscribe(object : SingleObserver<String> {
|
UserModel.get().saveLabel(list).subscribe(object : SingleObserver<String> {
|
||||||
@@ -82,7 +84,12 @@ class EditUserTagActivity : BaseViewBindingActivity<ActivityEditUserTagBinding>(
|
|||||||
|
|
||||||
override fun onSuccess(s: String) {
|
override fun onSuccess(s: String) {
|
||||||
dialogManager.dismissDialog()
|
dialogManager.dismissDialog()
|
||||||
|
val usersBean = UserModel.get().cacheLoginUserInfo
|
||||||
|
usersBean?.labels = mMyLabelAdapter.data
|
||||||
toast(getString(R.string.update_success))
|
toast(getString(R.string.update_success))
|
||||||
|
val intent = Intent()
|
||||||
|
intent.putExtra(KEY_LABEL, list)
|
||||||
|
setResult(RESULT_OK, intent)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +108,7 @@ class EditUserTagActivity : BaseViewBindingActivity<ActivityEditUserTagBinding>(
|
|||||||
|
|
||||||
private fun initData() {
|
private fun initData() {
|
||||||
dialogManager.showProgressDialog(
|
dialogManager.showProgressDialog(
|
||||||
this@EditUserTagActivity,
|
this@EditUserLabelActivity,
|
||||||
ResUtil.getString(R.string.ui_user_userinfomodifyactivity_02)
|
ResUtil.getString(R.string.ui_user_userinfomodifyactivity_02)
|
||||||
)
|
)
|
||||||
UserModel.get().userLabelInfo.subscribe(object : SingleObserver<UserLabelInfo> {
|
UserModel.get().userLabelInfo.subscribe(object : SingleObserver<UserLabelInfo> {
|
||||||
@@ -112,6 +119,14 @@ class EditUserTagActivity : BaseViewBindingActivity<ActivityEditUserTagBinding>(
|
|||||||
override fun onSuccess(data: UserLabelInfo) {
|
override fun onSuccess(data: UserLabelInfo) {
|
||||||
dialogManager.dismissDialog()
|
dialogManager.dismissDialog()
|
||||||
userLabelInfo = data
|
userLabelInfo = data
|
||||||
|
userLabelInfo?.meLabels?.let {
|
||||||
|
if (it.isNotEmpty()) {
|
||||||
|
binding.group.visibility = View.GONE
|
||||||
|
mMyLabelAdapter.setNewData(it)
|
||||||
|
} else {
|
||||||
|
binding.group.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
initTabTitle()
|
initTabTitle()
|
||||||
initViewPager()
|
initViewPager()
|
||||||
}
|
}
|
||||||
@@ -200,10 +215,16 @@ class EditUserTagActivity : BaseViewBindingActivity<ActivityEditUserTagBinding>(
|
|||||||
if (data.contains(event.label)) {
|
if (data.contains(event.label)) {
|
||||||
val pos = data.indexOf(event.label)
|
val pos = data.indexOf(event.label)
|
||||||
mMyLabelAdapter.remove(pos)
|
mMyLabelAdapter.remove(pos)
|
||||||
|
if (mMyLabelAdapter.data.size == 0) {
|
||||||
|
binding.group.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (data.size == 20) {
|
if (data.size == 20) {
|
||||||
toast(getString(R.string.max_to_add_label))
|
toast(getString(R.string.max_to_add_label))
|
||||||
} else {
|
} else {
|
||||||
|
if (mMyLabelAdapter.data.size == 0) {
|
||||||
|
binding.group.visibility = View.GONE
|
||||||
|
}
|
||||||
mMyLabelAdapter.addData(event.label)
|
mMyLabelAdapter.addData(event.label)
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,5 +1,7 @@
|
|||||||
package com.yizhuan.erban.ui.user.activity;
|
package com.yizhuan.erban.ui.user.activity;
|
||||||
|
|
||||||
|
import static com.yizhuan.erban.ui.user.activity.UserInfoActivity.IdentityState.OWN;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
@@ -100,8 +102,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.yizhuan.erban.ui.user.activity.UserInfoActivity.IdentityState.OWN;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create by lvzebiao on 2018/8/31
|
* create by lvzebiao on 2018/8/31
|
||||||
*/
|
*/
|
||||||
@@ -373,19 +373,20 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
|||||||
*/
|
*/
|
||||||
private void initLabel(List<String> labels) {
|
private void initLabel(List<String> labels) {
|
||||||
if (labels.isEmpty()) {
|
if (labels.isEmpty()) {
|
||||||
if (AuthModel.get().getCurrentUid() != userInfo.getUid()) {
|
if (AuthModel.get().getCurrentUid() != userId) {
|
||||||
mBinding.groupLabel.setVisibility(View.GONE);
|
mBinding.groupLabel.setVisibility(View.GONE);
|
||||||
mBinding.tvEditLabel.setVisibility(View.GONE);
|
mBinding.tvEditLabel.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
mBinding.groupLabel.setVisibility(View.GONE);
|
mBinding.groupLabel.setVisibility(View.GONE);
|
||||||
mBinding.tvEditLabel.setVisibility(View.VISIBLE);
|
mBinding.tvEditLabel.setVisibility(View.VISIBLE);
|
||||||
mBinding.tvEditLabel.setOnClickListener(view -> {
|
mBinding.tvEditLabel.setOnClickListener(view -> {
|
||||||
EditUserTagActivity.start(this);
|
EditUserLabelActivity.start(this);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
mBinding.groupLabel.setVisibility(View.VISIBLE);
|
mBinding.groupLabel.setVisibility(View.VISIBLE);
|
||||||
|
mBinding.tvEditLabel.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
UserInfoLabelAdapter userInfoLabelAdapter = new UserInfoLabelAdapter();
|
UserInfoLabelAdapter userInfoLabelAdapter = new UserInfoLabelAdapter();
|
||||||
|
|
||||||
@@ -544,7 +545,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.ivTagArrow:
|
case R.id.ivTagArrow:
|
||||||
UserLabelDialog.newInstance(userInfo.getLabels()).show(this);
|
UserLabelDialog.newInstance(userInfo.getLabels(), userId).show(this);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.iv_user_back:
|
case R.id.iv_user_back:
|
||||||
|
@@ -12,6 +12,8 @@ import android.view.View
|
|||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.fourmob.datetimepicker.date.DatePickerDialog
|
import com.fourmob.datetimepicker.date.DatePickerDialog
|
||||||
|
import com.google.android.flexbox.AlignItems
|
||||||
|
import com.google.android.flexbox.FlexDirection
|
||||||
import com.hjq.toast.ToastUtils
|
import com.hjq.toast.ToastUtils
|
||||||
import com.netease.nim.uikit.StatusBarUtil
|
import com.netease.nim.uikit.StatusBarUtil
|
||||||
import com.netease.nim.uikit.common.util.sys.TimeUtil
|
import com.netease.nim.uikit.common.util.sys.TimeUtil
|
||||||
@@ -27,10 +29,10 @@ import com.yizhuan.erban.base.BaseViewBindingActivity
|
|||||||
import com.yizhuan.erban.common.util.BitmapUtil
|
import com.yizhuan.erban.common.util.BitmapUtil
|
||||||
import com.yizhuan.erban.databinding.ActivityUserInfoModifyBinding
|
import com.yizhuan.erban.databinding.ActivityUserInfoModifyBinding
|
||||||
import com.yizhuan.erban.ui.login.ModifyInfoActivity
|
import com.yizhuan.erban.ui.login.ModifyInfoActivity
|
||||||
|
import com.yizhuan.erban.ui.user.adapter.UserInfoLabelAdapter
|
||||||
import com.yizhuan.erban.ui.user.adapter.UserPhotoAdapter
|
import com.yizhuan.erban.ui.user.adapter.UserPhotoAdapter
|
||||||
import com.yizhuan.erban.ui.user.adapter.UserPhotoAdapter.ImageClickListener
|
import com.yizhuan.erban.ui.user.adapter.UserPhotoAdapter.ImageClickListener
|
||||||
import com.yizhuan.erban.ui.user.dialog.UserAreaDialog
|
import com.yizhuan.erban.ui.user.dialog.UserAreaDialog
|
||||||
import com.yizhuan.erban.ui.user.dialog.UserLabelDialog.Companion.newInstance
|
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||||
import com.yizhuan.erban.ui.widget.dialog.CommonTipDialog
|
import com.yizhuan.erban.ui.widget.dialog.CommonTipDialog
|
||||||
import com.yizhuan.erban.utils.RegexUtil
|
import com.yizhuan.erban.utils.RegexUtil
|
||||||
@@ -44,6 +46,7 @@ import com.yizhuan.xchat_android_library.common.file.FileHelper
|
|||||||
import com.yizhuan.xchat_android_library.common.photo.PhotoProviderNew
|
import com.yizhuan.xchat_android_library.common.photo.PhotoProviderNew
|
||||||
import com.yizhuan.xchat_android_library.common.util.PhotoCompressCallback
|
import com.yizhuan.xchat_android_library.common.util.PhotoCompressCallback
|
||||||
import com.yizhuan.xchat_android_library.common.util.PhotoCompressUtil
|
import com.yizhuan.xchat_android_library.common.util.PhotoCompressUtil
|
||||||
|
import com.yizhuan.xchat_android_library.common.widget.LinesFlexBoxLayoutManager
|
||||||
import com.yizhuan.xchat_android_library.easypermisssion.EasyPermissions
|
import com.yizhuan.xchat_android_library.easypermisssion.EasyPermissions
|
||||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||||
import com.yizhuan.xchat_android_library.utils.TimeUtils
|
import com.yizhuan.xchat_android_library.utils.TimeUtils
|
||||||
@@ -171,6 +174,25 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
|||||||
this, calendar[Calendar.YEAR],
|
this, calendar[Calendar.YEAR],
|
||||||
calendar[Calendar.MONTH], calendar[Calendar.DAY_OF_MONTH], true
|
calendar[Calendar.MONTH], calendar[Calendar.DAY_OF_MONTH], true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val labelList = UserModel.get().cacheLoginUserInfo?.labels
|
||||||
|
if ((labelList?.size ?: 0) > 0) {
|
||||||
|
binding.tvTag.visibility = View.INVISIBLE
|
||||||
|
binding.mLabelRecyclerView.visibility = View.VISIBLE
|
||||||
|
val userInfoLabelAdapter = UserInfoLabelAdapter()
|
||||||
|
|
||||||
|
val labelLayoutManager = LinesFlexBoxLayoutManager(this)
|
||||||
|
labelLayoutManager.flexDirection = FlexDirection.ROW
|
||||||
|
labelLayoutManager.alignItems = AlignItems.FLEX_START
|
||||||
|
labelLayoutManager.setMaxLines(1)
|
||||||
|
binding.mLabelRecyclerView.layoutManager = labelLayoutManager
|
||||||
|
binding.mLabelRecyclerView.adapter = userInfoLabelAdapter
|
||||||
|
|
||||||
|
userInfoLabelAdapter.setNewData(labelList)
|
||||||
|
} else {
|
||||||
|
binding.tvTag.visibility = View.VISIBLE
|
||||||
|
binding.mLabelRecyclerView.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDateSet(datePickerDialog: DatePickerDialog, year: Int, month: Int, day: Int) {
|
override fun onDateSet(datePickerDialog: DatePickerDialog, year: Int, month: Int, day: Int) {
|
||||||
@@ -208,7 +230,16 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
|||||||
* 个人介绍
|
* 个人介绍
|
||||||
*/
|
*/
|
||||||
const val DESC = 4
|
const val DESC = 4
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拍照
|
||||||
|
*/
|
||||||
const val PHOTO = 5
|
const val PHOTO = 5
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签
|
||||||
|
*/
|
||||||
|
const val LABEL = 6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,9 +315,11 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
|||||||
override fun onSuccess(areaList: List<String>) {
|
override fun onSuccess(areaList: List<String>) {
|
||||||
dialogManager.dismissDialog()
|
dialogManager.dismissDialog()
|
||||||
UserAreaDialog.newInstance(areaList)
|
UserAreaDialog.newInstance(areaList)
|
||||||
.apply { setAction {
|
.apply {
|
||||||
reportArea(it)
|
setAction {
|
||||||
} }.show(this@UserInfoModifyActivity)
|
reportArea(it)
|
||||||
|
}
|
||||||
|
}.show(this@UserInfoModifyActivity)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
@@ -297,7 +330,7 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
R.id.layout_tag -> {
|
R.id.layout_tag -> {
|
||||||
EditUserTagActivity.start(this@UserInfoModifyActivity)
|
UIHelper.showLabelInfoAct(this, Method.LABEL)
|
||||||
}
|
}
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
@@ -436,6 +469,29 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
|||||||
.subscribe(userInfoUpdateObserver)
|
.subscribe(userInfoUpdateObserver)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Method.LABEL -> {
|
||||||
|
data?.let {
|
||||||
|
val label = it.getStringExtra(EditUserLabelActivity.KEY_LABEL)
|
||||||
|
val labelList = label?.split(",")
|
||||||
|
if ((labelList?.size ?: 0) > 0) {
|
||||||
|
binding.tvTag.visibility = View.INVISIBLE
|
||||||
|
binding.mLabelRecyclerView.visibility = View.VISIBLE
|
||||||
|
val userInfoLabelAdapter = UserInfoLabelAdapter()
|
||||||
|
|
||||||
|
val labelLayoutManager = LinesFlexBoxLayoutManager(this)
|
||||||
|
labelLayoutManager.flexDirection = FlexDirection.ROW
|
||||||
|
labelLayoutManager.alignItems = AlignItems.FLEX_START
|
||||||
|
labelLayoutManager.setMaxLines(1)
|
||||||
|
binding.mLabelRecyclerView.layoutManager = labelLayoutManager
|
||||||
|
binding.mLabelRecyclerView.adapter = userInfoLabelAdapter
|
||||||
|
|
||||||
|
userInfoLabelAdapter.setNewData(labelList)
|
||||||
|
} else {
|
||||||
|
binding.tvTag.visibility = View.VISIBLE
|
||||||
|
binding.mLabelRecyclerView.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Method.AUDIO -> {// 刷新声音资源
|
Method.AUDIO -> {// 刷新声音资源
|
||||||
data?.let {
|
data?.let {
|
||||||
// 获取数据并刷新显示
|
// 获取数据并刷新显示
|
||||||
|
@@ -9,10 +9,9 @@ import com.google.android.flexbox.JustifyContent
|
|||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.erban.base.BaseDialog
|
import com.yizhuan.erban.base.BaseDialog
|
||||||
import com.yizhuan.erban.databinding.DialogUserTagBinding
|
import com.yizhuan.erban.databinding.DialogUserTagBinding
|
||||||
import com.yizhuan.erban.ui.user.activity.EditUserTagActivity
|
import com.yizhuan.erban.ui.user.activity.EditUserLabelActivity
|
||||||
import com.yizhuan.erban.ui.user.adapter.UserLabelDialogAdapter
|
import com.yizhuan.erban.ui.user.adapter.UserLabelDialogAdapter
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||||
import com.yizhuan.xchat_android_core.user.UserModel
|
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,12 +22,15 @@ class UserLabelDialog :
|
|||||||
BaseDialog<DialogUserTagBinding>() {
|
BaseDialog<DialogUserTagBinding>() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
const val KEY_USER_ID = "key_user_id"
|
||||||
const val KEY_LABEL = "key_label"
|
const val KEY_LABEL = "key_label"
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun newInstance(label: List<String>): UserLabelDialog {
|
fun newInstance(label: MutableList<String>, userId: Long): UserLabelDialog {
|
||||||
val userLabelDialog = UserLabelDialog()
|
val userLabelDialog = UserLabelDialog()
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
|
bundle.putLong(KEY_USER_ID, userId)
|
||||||
bundle.putSerializable(KEY_LABEL, label as Serializable?)
|
bundle.putSerializable(KEY_LABEL, label as Serializable?)
|
||||||
userLabelDialog.arguments = bundle
|
userLabelDialog.arguments = bundle
|
||||||
return userLabelDialog
|
return userLabelDialog
|
||||||
@@ -48,7 +50,7 @@ class UserLabelDialog :
|
|||||||
|
|
||||||
binding.tvEdit.setOnClickListener {
|
binding.tvEdit.setOnClickListener {
|
||||||
dismissAllowingStateLoss()
|
dismissAllowingStateLoss()
|
||||||
context?.let { it1 -> EditUserTagActivity.start(it1) }
|
context?.let { it1 -> EditUserLabelActivity.start(it1) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +64,8 @@ class UserLabelDialog :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun initLabel() {
|
private fun initLabel() {
|
||||||
if (AuthModel.get().currentUid != UserModel.get().cacheLoginUserInfo?.uid) {
|
val userId = arguments?.getLong(KEY_USER_ID) ?: 0L
|
||||||
|
if (AuthModel.get().currentUid != userId) {
|
||||||
binding.tvTitle.text = getString(R.string.other_label)
|
binding.tvTitle.text = getString(R.string.other_label)
|
||||||
binding.tvEdit.visibility = View.GONE
|
binding.tvEdit.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/color_white"
|
android:background="@color/color_white"
|
||||||
tools:context=".ui.user.activity.EditUserTagActivity">
|
tools:context=".ui.user.activity.EditUserLabelActivity">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/view_bg"
|
android:id="@+id/view_bg"
|
@@ -3,7 +3,8 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/bg_normal_1c1b22"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:background="@color/color_white"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.yizhuan.erban.base.TitleBar
|
<com.yizhuan.erban.base.TitleBar
|
||||||
@@ -249,7 +250,7 @@
|
|||||||
android:layout_marginRight="15dp"
|
android:layout_marginRight="15dp"
|
||||||
android:background="@color/line_353548" />
|
android:background="@color/line_353548" />
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/layout_tag"
|
android:id="@+id/layout_tag"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
@@ -263,26 +264,43 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/layout_item_user_03"
|
android:text="@string/layout_item_user_03"
|
||||||
android:textColor="@color/text_title_color"
|
android:textColor="@color/text_title_color"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_tag"
|
android:id="@+id/tv_tag"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center_vertical|end"
|
android:gravity="center_vertical|end"
|
||||||
android:textColor="@color/color_6D6B89"
|
android:textColor="@color/color_6D6B89"
|
||||||
android:textSize="@dimen/font_normal"
|
android:textSize="@dimen/font_normal"
|
||||||
android:text="@string/setting_personal_tags_will_be_more_popular"/>
|
android:text="@string/setting_personal_tags_will_be_more_popular"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/iv_label_arrow"/>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/mLabelRecyclerView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/tv_tag"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/tv_tag"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/iv_label_arrow"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:padding="15dp"
|
android:padding="15dp"
|
||||||
android:src="@drawable/arrow_right" />
|
android:src="@drawable/arrow_right"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
android:id="@+id/mRecyclerView"
|
android:id="@+id/mRecyclerView"
|
||||||
android:layout_marginTop="@dimen/dp_7"
|
android:layout_marginTop="@dimen/dp_7"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="120dp"
|
||||||
android:layout_marginStart="@dimen/dp_15"
|
android:layout_marginStart="@dimen/dp_15"
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tvTitle"
|
app:layout_constraintTop_toBottomOf="@+id/tvTitle"
|
||||||
|
@@ -308,6 +308,7 @@ public class UserInfo implements Serializable {
|
|||||||
* 标签
|
* 标签
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
@Setter
|
||||||
private List<String> labels;
|
private List<String> labels;
|
||||||
|
|
||||||
public UserInfo() {
|
public UserInfo() {
|
||||||
|
Reference in New Issue
Block a user