1个人中心加tab 2.技能卡 添加类型刷新 3.技能卡添加蒙层指引
This commit is contained in:
@@ -1263,6 +1263,10 @@
|
||||
android:name=".home.activity.VisitorListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity android:name=".skill.activity.SkillDetailActivity"
|
||||
android:screenOrientation="portrait"
|
||||
/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -53,6 +53,7 @@ import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StarUtils;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBusHelper;
|
||||
|
||||
@@ -63,6 +64,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import lombok.val;
|
||||
|
||||
/**
|
||||
* @description: 我的 界面
|
||||
* @author: hewenhao
|
||||
@@ -71,6 +74,7 @@ import java.util.Locale;
|
||||
public class MeFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
public static final String TAG = "MeFragment";
|
||||
private static final String HAS_SHOW_GUIDE = "has_show_guide";
|
||||
|
||||
private UserInfo mUserInfo;
|
||||
private FragmentMeBinding mBinding;
|
||||
@@ -148,6 +152,27 @@ public class MeFragment extends BaseFragment implements View.OnClickListener {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
showGuideView();
|
||||
}
|
||||
|
||||
private void showGuideView() {
|
||||
final boolean hasShowGuid = (boolean) SharedPreferenceUtils.get(HAS_SHOW_GUIDE, false);
|
||||
//!hasShowGuid
|
||||
if (true) {
|
||||
SharedPreferenceUtils.put(HAS_SHOW_GUIDE, true);
|
||||
mBinding.ivOverlayGuide.setVisibility(View.VISIBLE);
|
||||
WindowManager.LayoutParams params = getActivity().getWindow().getAttributes();
|
||||
final float originAlpha = params.alpha;
|
||||
params.alpha = 0.3f;
|
||||
getActivity().getWindow().setAttributes(params);
|
||||
mBinding.ivOverlayGuide.setOnClickListener(v -> {
|
||||
params.alpha = originAlpha;
|
||||
getActivity().getWindow().setAttributes(params);
|
||||
mBinding.ivOverlayGuide.setVisibility(View.GONE);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private void onGetRelationShipEvent(RelationShipEvent event) {
|
||||
@@ -347,7 +372,7 @@ public class MeFragment extends BaseFragment implements View.OnClickListener {
|
||||
ScheduleManageActivity.Companion.start(mContext);
|
||||
break;
|
||||
case R.id.me_item_skill:
|
||||
ActivitySkillHome.Companion.start(mContext);
|
||||
ActivitySkillHome.Companion.start(mContext, 0);
|
||||
break;
|
||||
case R.id.me_item_visitor:
|
||||
EventBus.getDefault().post(new VisitorUnreadCountEvent(0));
|
||||
|
@@ -73,44 +73,25 @@ class ActivitySkillEditDelegate(
|
||||
Consumer {
|
||||
activity.dialogManager.dismissDialog()
|
||||
activity.toast("保存成功")
|
||||
EventBus.getDefault().post(SkillEvent())
|
||||
val event = SkillEvent()
|
||||
event.event = SkillEvent.ADD
|
||||
EventBus.getDefault().post(event)
|
||||
activity.finish()
|
||||
},
|
||||
Consumer { th ->
|
||||
th.printStackTrace()
|
||||
activity.toast(th.message)
|
||||
activity.dialogManager.dismissDialog()
|
||||
activity.toast("保存失败")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
internal fun setSkillViewData(entity: SkillRecordEntity) {
|
||||
entity.isSelf = true
|
||||
entity.isEdit = true
|
||||
activity.mBinding.skillView.setItems(entity,
|
||||
object : SelectionItem.OnItemSelectionListener {
|
||||
override fun onItemSelection(
|
||||
item: SkillItem
|
||||
) {
|
||||
val propertyEntity = SkillDataManager.get().getPropertyEntity(entity.cardId)
|
||||
if (propertyEntity == null) {
|
||||
SkillModel.instance.getCardInfoById(entity.cardId)
|
||||
.compose(activity.bindToLifecycle())
|
||||
.doOnSubscribe { activity.dialogManager.showProgressDialog(activity) }
|
||||
.subscribe(Consumer {
|
||||
SkillDataManager.get().setSkillPropertyEntity(entity.cardId, it)
|
||||
setSelectionData(item, it)
|
||||
activity.dialogManager.dismissDialog()
|
||||
}, Consumer { th ->
|
||||
th.printStackTrace()
|
||||
setSelectionData(item, null)
|
||||
activity.dialogManager.dismissDialog()
|
||||
})
|
||||
} else {
|
||||
setSelectionData(item, propertyEntity)
|
||||
}
|
||||
}
|
||||
})
|
||||
internal fun setSkillViewData(isSelf: Boolean, isEdit: Boolean, entity: SkillRecordEntity) {
|
||||
entity.isSelf = isSelf
|
||||
entity.isEdit = isEdit
|
||||
val listener = if (isSelf && isEdit) DefaultItemSelectionListenerImp(entity) else null
|
||||
activity.mBinding.skillView.setItems(entity, listener)
|
||||
}
|
||||
|
||||
private fun setSelectionData(item: SkillItem, propertyEntity: SkillPropertyEntity?) {
|
||||
@@ -120,4 +101,32 @@ class ActivitySkillEditDelegate(
|
||||
}
|
||||
showSelectionValueDialog(item, propDictVos)
|
||||
}
|
||||
|
||||
inner class DefaultItemSelectionListenerImp(private val entity: SkillRecordEntity) :
|
||||
SelectionItem.OnItemSelectionListener {
|
||||
override fun onItemSelection(item: SkillItem) {
|
||||
val propertyEntity = SkillDataManager.get().getPropertyEntity(entity.cardId)
|
||||
if (propertyEntity == null) {
|
||||
SkillModel.instance.getCardInfoById(entity.cardId)
|
||||
.compose(activity.bindToLifecycle())
|
||||
.doOnSubscribe { activity.dialogManager.showProgressDialog(activity) }
|
||||
.subscribe(Consumer {
|
||||
SkillDataManager.get().setSkillPropertyEntity(entity.cardId, it)
|
||||
setSelectionData(item, it)
|
||||
activity.dialogManager.dismissDialog()
|
||||
}, Consumer { th ->
|
||||
th.printStackTrace()
|
||||
activity.toast(th.message)
|
||||
setSelectionData(item, null)
|
||||
activity.dialogManager.dismissDialog()
|
||||
})
|
||||
} else {
|
||||
setSelectionData(item, propertyEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val RECORD_ID = "record_id"
|
||||
}
|
||||
}
|
@@ -10,11 +10,11 @@ import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseBindingActivity
|
||||
import com.yizhuan.erban.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.databinding.ActivitySkillHomeBinding
|
||||
import com.yizhuan.erban.skill.adapter.MineSkillCardAdapter
|
||||
import com.yizhuan.erban.skill.decoration.MineSkillListDecoration
|
||||
import com.yizhuan.erban.skill.decoration.SkillLinearVerticalDecoration
|
||||
import com.yizhuan.erban.skill.dialog.AddSkillCardDialog
|
||||
import com.yizhuan.erban.skill.entity.SkillPropertyEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillTypeEntity
|
||||
import com.yizhuan.erban.skill.event.SkillEvent
|
||||
import com.yizhuan.erban.skill.repository.SkillDataManager
|
||||
@@ -29,21 +29,23 @@ import org.greenrobot.eventbus.ThreadMode
|
||||
@ActLayoutRes(R.layout.activity_skill_home)
|
||||
class ActivitySkillHome : BaseBindingActivity<ActivitySkillHomeBinding>() {
|
||||
private lateinit var adapter: MineSkillCardAdapter
|
||||
private var addDialog: AddSkillCardDialog? = null
|
||||
private var skillTypeList: List<SkillTypeEntity>? = null
|
||||
private var pageType = 0 //' 0 主态
|
||||
override fun init() {
|
||||
initTitleBar("技能卡")
|
||||
pageType = intent.getIntExtra(PAGE_TYPE, 0)
|
||||
EventBus.getDefault().register(this)
|
||||
mBinding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
adapter = MineSkillCardAdapter(true)
|
||||
adapter = MineSkillCardAdapter(pageType == 0)
|
||||
mBinding.recyclerView.adapter = adapter
|
||||
mBinding.recyclerView.addItemDecoration(MineSkillListDecoration(this, 6, 16))
|
||||
adapter.setHeaderAndEmpty(true)
|
||||
adapter.addHeaderView(createHeaderView())
|
||||
mBinding.recyclerView.addItemDecoration(SkillLinearVerticalDecoration(this, 6, 16))
|
||||
adapter.setOnItemClickListener { _, _, position ->
|
||||
val item = adapter.getItem(position)
|
||||
EditSkillActivity.start(this, item?.id ?: -1)
|
||||
if (pageType != 0) return@setOnItemClickListener
|
||||
adapter.getItem(position)?.let {
|
||||
EditSkillActivity.start(this, it.id)
|
||||
}
|
||||
}
|
||||
adapter.addHeaderView(createHeaderView())
|
||||
mBinding.refreshLayout.setOnRefreshListener {
|
||||
loadUserSkillList()
|
||||
}
|
||||
@@ -56,6 +58,7 @@ class ActivitySkillHome : BaseBindingActivity<ActivitySkillHomeBinding>() {
|
||||
dialogManager.dismissDialog()
|
||||
},
|
||||
Consumer { th ->
|
||||
toast(th.message)
|
||||
th.printStackTrace()
|
||||
skillTypeList = ArrayList(0)
|
||||
loadUserSkillList()
|
||||
@@ -73,7 +76,9 @@ class ActivitySkillHome : BaseBindingActivity<ActivitySkillHomeBinding>() {
|
||||
if (mBinding.refreshLayout.isRefreshing) {
|
||||
mBinding.refreshLayout.isRefreshing = false
|
||||
}
|
||||
adapter.setHeaderAndEmpty(true)
|
||||
if (pageType == 0) {
|
||||
adapter.setHeaderAndEmpty(true)
|
||||
}
|
||||
//这里没有做加载功能
|
||||
adapter.setNewData(it)
|
||||
if (it.isEmpty()) {
|
||||
@@ -84,6 +89,7 @@ class ActivitySkillHome : BaseBindingActivity<ActivitySkillHomeBinding>() {
|
||||
},
|
||||
Consumer { th ->
|
||||
th.printStackTrace()
|
||||
toast(th.message)
|
||||
mBinding.refreshLayout.isRefreshing = false
|
||||
adapter.setHeaderAndEmpty(false)
|
||||
adapter.emptyView = createEmptyView()
|
||||
@@ -94,10 +100,15 @@ class ActivitySkillHome : BaseBindingActivity<ActivitySkillHomeBinding>() {
|
||||
|
||||
|
||||
private fun createEmptyView(): View {
|
||||
val rootHeight = UIUtil.dip2px(this, 180.0)
|
||||
if (pageType == 0) {
|
||||
return EmptyViewHelper.createEmptyView(this, "暂未添加技能卡")
|
||||
}
|
||||
val rootView = FrameLayout(this)
|
||||
rootView.layoutParams =
|
||||
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, rootHeight)
|
||||
ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
rootView.background = resources.getDrawable(R.drawable.bg_skill_add)
|
||||
val imageView = ImageView(this)
|
||||
val height = UIUtil.dip2px(this, 50.0)
|
||||
@@ -124,21 +135,18 @@ class ActivitySkillHome : BaseBindingActivity<ActivitySkillHomeBinding>() {
|
||||
}
|
||||
|
||||
private fun showAddableSkillDialog() {
|
||||
if (addDialog == null) {
|
||||
addDialog = AddSkillCardDialog(context, skillTypeList!!) {
|
||||
AddSkillActivity.start(this, it.cardId)
|
||||
}
|
||||
}
|
||||
if (addDialog?.isShowing == true) {
|
||||
addDialog?.closeDialog()
|
||||
val addDialog = AddSkillCardDialog(context, skillTypeList!!) {
|
||||
AddSkillActivity.start(this, it.cardId)
|
||||
}
|
||||
addDialog?.openDialog()
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
fun start(context: Context) {
|
||||
const val PAGE_TYPE = "page_type"
|
||||
fun start(context: Context, pageType: Int) {
|
||||
val intent = Intent(context, ActivitySkillHome::class.java)
|
||||
intent.putExtra(PAGE_TYPE, pageType)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
@@ -152,5 +160,14 @@ class ActivitySkillHome : BaseBindingActivity<ActivitySkillHomeBinding>() {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onDataChangedEvent(event: SkillEvent) {
|
||||
loadUserSkillList()
|
||||
if (event.event == SkillEvent.ADD || event.event == SkillEvent.REMOVE) {
|
||||
SkillModel.instance.getSkillTypeList()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
skillTypeList = it
|
||||
}, { th -> th.printStackTrace()
|
||||
toast(th.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
@@ -38,7 +38,9 @@ class AddSkillActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
.subscribe(Consumer {
|
||||
SkillDataManager.get().setSkillPropertyEntity(cardId, it)
|
||||
setSkillViewData(it)
|
||||
}, Consumer { th -> th.printStackTrace() })
|
||||
}, Consumer { th -> th.printStackTrace()
|
||||
toast(th.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +58,7 @@ class AddSkillActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
it.cardId, null, it.icon, -1, it.name,
|
||||
it.pic, propList, it.type, null
|
||||
)
|
||||
delegate.setSkillViewData(entity)
|
||||
delegate.setSkillViewData(isSelf = true, isEdit = true, entity = entity)
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,7 +22,7 @@ class EditSkillActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
mBinding.click = this
|
||||
mDelegate = ActivitySkillEditDelegate(this)
|
||||
mDelegate.init()
|
||||
recordId = intent?.getIntExtra(ITEM_ID, -1) ?: -1
|
||||
recordId = intent?.getIntExtra(ActivitySkillEditDelegate.RECORD_ID, -1) ?: -1
|
||||
if (recordId >= 0) {
|
||||
loadData()
|
||||
}
|
||||
@@ -67,11 +67,13 @@ class EditSkillActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(Consumer {
|
||||
toast("删除成功")
|
||||
EventBus.getDefault().post(SkillEvent())
|
||||
val event = SkillEvent()
|
||||
event.event = SkillEvent.REMOVE
|
||||
EventBus.getDefault().post(event)
|
||||
finish()
|
||||
}, Consumer { th ->
|
||||
th.printStackTrace()
|
||||
toast("删除失败")
|
||||
toast(th.message)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -81,20 +83,20 @@ class EditSkillActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSubscribe { dialogManager.showProgressDialog(this) }
|
||||
.subscribe(Consumer {
|
||||
mDelegate.setSkillViewData(it)
|
||||
mDelegate.setSkillViewData(isSelf = true, isEdit = true, entity = it)
|
||||
dialogManager.dismissDialog()
|
||||
}, Consumer { th ->
|
||||
th.printStackTrace()
|
||||
toast(th.message)
|
||||
dialogManager.dismissDialog()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val ITEM_ID = "item_id"
|
||||
fun start(context: Context, id: Int) {
|
||||
val intent = Intent(context, EditSkillActivity::class.java)
|
||||
intent.putExtra(ITEM_ID, id)
|
||||
intent.putExtra(ActivitySkillEditDelegate.RECORD_ID, id)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,53 @@
|
||||
package com.yizhuan.erban.skill.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseBindingActivity
|
||||
import com.yizhuan.erban.databinding.ActivitySkillEditBinding
|
||||
import com.yizhuan.erban.skill.repository.SkillModel
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import io.reactivex.functions.Consumer
|
||||
|
||||
/**
|
||||
* 客态显示
|
||||
*/
|
||||
@ActLayoutRes(R.layout.activity_skill_edit)
|
||||
class SkillDetailActivity : BaseBindingActivity<ActivitySkillEditBinding>() {
|
||||
private lateinit var mDelegate: ActivitySkillEditDelegate
|
||||
private var recordId = -1
|
||||
override fun init() {
|
||||
mDelegate = ActivitySkillEditDelegate(this)
|
||||
mDelegate.init()
|
||||
mBinding.btnSave.visibility = View.GONE
|
||||
mBinding.btnDelete.visibility = View.GONE
|
||||
recordId = intent?.getIntExtra(ActivitySkillEditDelegate.RECORD_ID, -1) ?: -1
|
||||
if (recordId >= 0) {
|
||||
loadData()
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadData() {
|
||||
SkillModel.instance.getSkillDetailById(recordId)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSubscribe { dialogManager.showProgressDialog(this) }
|
||||
.subscribe(Consumer {
|
||||
mDelegate.setSkillViewData(isSelf = false, isEdit = false, entity = it)
|
||||
dialogManager.dismissDialog()
|
||||
}, Consumer { th ->
|
||||
th.printStackTrace()
|
||||
toast(th.message)
|
||||
dialogManager.dismissDialog()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun start(context: Context, id: Int) {
|
||||
val intent = Intent(context, SkillDetailActivity::class.java)
|
||||
intent.putExtra(ActivitySkillEditDelegate.RECORD_ID, id)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,7 +6,7 @@ import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
|
||||
class MineSkillListDecoration(context: Context, topSpaceDp: Int, bottomSpaceDp: Int) :
|
||||
class SkillLinearVerticalDecoration(context: Context, topSpaceDp: Int, bottomSpaceDp: Int) :
|
||||
RecyclerView.ItemDecoration() {
|
||||
private var topSpace = 0
|
||||
private var bottomSpace = 0
|
@@ -1,4 +1,18 @@
|
||||
package com.yizhuan.erban.skill.event;
|
||||
|
||||
|
||||
public class SkillEvent {
|
||||
|
||||
private int event;
|
||||
|
||||
public static final int ADD = 1;
|
||||
public static final int REMOVE = 2;
|
||||
|
||||
public int getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
public void setEvent(int event) {
|
||||
this.event = event;
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ import com.yizhuan.erban.skill.entity.SkillPropertyEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillRecordEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillTypeEntity
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
|
||||
import io.reactivex.Single
|
||||
import okhttp3.RequestBody
|
||||
import retrofit2.http.*
|
||||
@@ -21,11 +22,14 @@ interface Api {
|
||||
|
||||
@Headers("Content-Type: application/json")
|
||||
@POST("/skillCard/saveOrUpdate")
|
||||
fun saveCardInfo(@Body body:RequestBody):Single<ServiceResult<JsonElement>>
|
||||
fun saveCardInfo(@Body body: RequestBody): Single<ServiceResult<JsonElement>>
|
||||
|
||||
@POST("/skillCard/delete")
|
||||
fun deleteSkill(@Query("id") id: String): Single<ServiceResult<JsonElement>>
|
||||
@GET("/skillCard/get")
|
||||
fun getSkillDetailById(@Query("id")id:String):Single<ServiceResult<SkillRecordEntity>>
|
||||
|
||||
@GET("/skillCard/get")
|
||||
fun getSkillDetailById(@Query("id") id: String): Single<ServiceResult<SkillRecordEntity>>
|
||||
|
||||
@GET("/skillCard/cardList")
|
||||
fun getUserInfoSkillList(): Single<ServiceResult<List<UserInfoSkillEntity>>>
|
||||
}
|
@@ -4,6 +4,7 @@ import com.yizhuan.erban.skill.entity.SkillPostServerEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillPropertyEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillRecordEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillTypeEntity
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
|
||||
import io.reactivex.Single
|
||||
|
||||
|
||||
@@ -11,7 +12,8 @@ interface ISkillModel {
|
||||
fun getUserAllSkillCardDetail(): Single<List<SkillRecordEntity>>
|
||||
fun getSkillTypeList(): Single<List<SkillTypeEntity>>
|
||||
fun getCardInfoById(id: Int): Single<SkillPropertyEntity>
|
||||
fun saveSkillInfo(entity:SkillPostServerEntity):Single<String>
|
||||
fun deleteSkill(id:Int):Single<String>
|
||||
fun getSkillDetailById(id:Int):Single<SkillRecordEntity>
|
||||
fun saveSkillInfo(entity: SkillPostServerEntity): Single<String>
|
||||
fun deleteSkill(id: Int): Single<String>
|
||||
fun getSkillDetailById(id: Int): Single<SkillRecordEntity>
|
||||
fun getUserInfoSkillList(): Single<List<UserInfoSkillEntity>>
|
||||
}
|
@@ -1,18 +1,15 @@
|
||||
package com.yizhuan.erban.skill.repository
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonElement
|
||||
import com.yizhuan.erban.skill.entity.SkillPostServerEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillPropertyEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillRecordEntity
|
||||
import com.yizhuan.erban.skill.entity.SkillTypeEntity
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet
|
||||
import io.reactivex.Single
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.MediaType
|
||||
import okhttp3.RequestBody
|
||||
|
||||
@@ -21,21 +18,17 @@ class SkillModel : BaseModel(), ISkillModel {
|
||||
override fun getUserAllSkillCardDetail(): Single<List<SkillRecordEntity>> =
|
||||
api.getUserAllSkillCardDetail().compose(RxHelper.handleCommon {
|
||||
ArrayList(0)
|
||||
}).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
})
|
||||
|
||||
override fun getSkillTypeList(): Single<List<SkillTypeEntity>> {
|
||||
return api.getSkillTypeList().compose(RxHelper.handleCommon {
|
||||
ArrayList(0)
|
||||
}).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
})
|
||||
}
|
||||
|
||||
override fun getCardInfoById(id: Int): Single<SkillPropertyEntity> {
|
||||
return api.getCardInfoById(id.toString())
|
||||
.compose(RxHelper.handleCommon())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
}
|
||||
|
||||
override fun saveSkillInfo(entity: SkillPostServerEntity): Single<String> {
|
||||
@@ -45,22 +38,21 @@ class SkillModel : BaseModel(), ISkillModel {
|
||||
)
|
||||
return api.saveCardInfo(requestBody)
|
||||
.compose(RxHelper.handleIgnoreData())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
}
|
||||
|
||||
override fun deleteSkill(id: Int): Single<String> {
|
||||
return api.deleteSkill(id.toString())
|
||||
.compose(RxHelper.handleIgnoreData())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
}
|
||||
|
||||
override fun getSkillDetailById(id: Int): Single<SkillRecordEntity> {
|
||||
return api.getSkillDetailById(id.toString())
|
||||
.compose(RxHelper.handleCommon())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
}
|
||||
|
||||
override fun getUserInfoSkillList(): Single<List<UserInfoSkillEntity>> {
|
||||
return api.getUserInfoSkillList()
|
||||
.compose(RxHelper.handleCommon { ArrayList(0) })
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@@ -0,0 +1,13 @@
|
||||
package com.yizhuan.erban.ui.user
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
|
||||
object GradientDrawableCreator {
|
||||
fun createDrawable(radius: Int, color: Int): Drawable {
|
||||
val drawable = GradientDrawable()
|
||||
drawable.cornerRadius = radius.toFloat()
|
||||
drawable.setColor(color)
|
||||
return drawable
|
||||
}
|
||||
}
|
@@ -5,7 +5,6 @@ import static com.yizhuan.erban.ui.user.UserInfoActivity.IdentityState.OWN;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
@@ -15,14 +14,19 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity;
|
||||
import com.yizhuan.erban.ui.user.adapter.SelfPhotoAdapter;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2;
|
||||
import com.yizhuan.erban.ui.user.adapter.UserInfoIndicatorAdapter;
|
||||
import com.yizhuan.erban.ui.user.adapter.UserInfoPagerAdapter;
|
||||
import com.yizhuan.erban.ui.user.view.UserInfoDynamicFragment;
|
||||
import com.yizhuan.erban.ui.user.view.UserInfoInfoFragment;
|
||||
import com.yizhuan.erban.ui.user.viewmodel.UserInfoViewModel;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapterWrapper;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.TextHintView;
|
||||
import com.netease.nim.uikit.impl.cache.NimUserInfoCache;
|
||||
@@ -43,10 +47,8 @@ import com.yizhuan.erban.family.view.activity.FamilyHomeActivity;
|
||||
import com.yizhuan.erban.family.view.activity.FamilyMemberListActivity;
|
||||
import com.yizhuan.erban.family.view.activity.FamilyMemberSearchActivity;
|
||||
import com.yizhuan.erban.module_hall.HallDataManager;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimFriendModel;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.erban.ui.user.adapter.GiftAdapter;
|
||||
import com.yizhuan.erban.ui.user.adapter.UserInfoDynamicAdapter;
|
||||
import com.yizhuan.erban.ui.user.adapter.UserInfoPhotoAdapter;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
@@ -86,7 +88,6 @@ import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -119,10 +120,10 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
private ImageView ivOfficialMask;
|
||||
private TextView tvOfficialMask;
|
||||
|
||||
private long mRoomUid;
|
||||
private GiftAdapter giftAdapter;
|
||||
private StaticPagerAdapterWrapper bannerAdapter;
|
||||
private UserInfoDynamicAdapter dynamicAdapter;
|
||||
|
||||
private UserInfoViewModel viewModel;
|
||||
private UserInfoPagerAdapter pagerAdapter;
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
@@ -134,22 +135,25 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
onFindViews();
|
||||
onSetListener();
|
||||
EventBus.getDefault().register(this);
|
||||
initUserInfoDetailObserver();
|
||||
getUserInfo();
|
||||
initAttentionView();
|
||||
initNestScrollView();
|
||||
setEditButton(identityState, true);
|
||||
setBackBottom(true);
|
||||
setTitleVisible(false);
|
||||
initViewPager();
|
||||
if (userId != AuthModel.get().getCurrentUid()) {
|
||||
UserModel.get().visitUserDetail(userId).subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
getUserInfoDetail();
|
||||
initClanAndHall();
|
||||
viewModel.getUserInfoDetail();
|
||||
viewModel.getUserHallAndClan();
|
||||
}
|
||||
|
||||
private void initAttentionView() {
|
||||
@@ -182,16 +186,14 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
mBinding.ivUserBack.setOnClickListener(this);
|
||||
mBinding.ivEdit.setOnClickListener(this);
|
||||
mBinding.tvEdit.setOnClickListener(this);
|
||||
mBinding.tvGiftDetail.setOnClickListener(this);
|
||||
mBinding.ivWhere.setOnClickListener(this);
|
||||
mBinding.llModuleHall.setOnClickListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 找到TA, 主态不展示
|
||||
*/
|
||||
private void setWhereVisible() {
|
||||
mBinding.ivWhere.setVisibility(mRoomUid != 0 ? View.VISIBLE : View.GONE);
|
||||
mBinding.ivWhere.setVisibility(viewModel.getMRoomUid() != 0 ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
private void getUserInfo() {
|
||||
@@ -211,20 +213,34 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
});
|
||||
}
|
||||
|
||||
private void getUserInfoDetail() {
|
||||
UserModel.get().getUserInfoDetail(userId)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new BeanObserver<UserDetailInfo>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
private void initViewPager() {
|
||||
List<Fragment> fragmentList = new ArrayList<>(2);
|
||||
fragmentList.add(new UserInfoInfoFragment());
|
||||
fragmentList.add(new UserInfoDynamicFragment());
|
||||
pagerAdapter = new UserInfoPagerAdapter(getSupportFragmentManager(), fragmentList);
|
||||
final List<String> tagList = new ArrayList<>(2);
|
||||
tagList.add("资料");
|
||||
tagList.add("动态");
|
||||
CommonNavigator commonNavigator = new CommonNavigator(context);
|
||||
commonNavigator.setTitleWrapContent(true);
|
||||
UserInfoIndicatorAdapter magicIndicatorAdapter = new UserInfoIndicatorAdapter(context, tagList);
|
||||
magicIndicatorAdapter.setOnItemSelectListener((position, view) -> {
|
||||
mBinding.viewPager.setCurrentItem(position);
|
||||
});
|
||||
commonNavigator.setAdapter(magicIndicatorAdapter);
|
||||
mBinding.magicIndicator.setNavigator(commonNavigator);
|
||||
commonNavigator.getTitleContainer().setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
|
||||
mBinding.viewPager.setOffscreenPageLimit(2);
|
||||
mBinding.viewPager.setAdapter(pagerAdapter);
|
||||
ViewPagerHelper.bind(mBinding.magicIndicator, mBinding.viewPager);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserDetailInfo info) {
|
||||
initUserDetail(info.getData());
|
||||
}
|
||||
});
|
||||
private void initUserInfoDetailObserver() {
|
||||
viewModel = new ViewModelProvider(this).get(UserInfoViewModel.class);
|
||||
viewModel.getUserInfoDetailData().observe(this, dataBean -> {
|
||||
initPhoto(dataBean.getPrivatePhoto());
|
||||
setWhereVisible();
|
||||
});
|
||||
}
|
||||
|
||||
private void setBackBottom(boolean isExpanded) {
|
||||
@@ -307,174 +323,6 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"CheckResult", "SetTextI18n"})
|
||||
private void initClanAndHall() {
|
||||
HallModel.get().getUserHallAndClan(userId)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(clanAndHallInfo -> {
|
||||
HallInfo hallInfo = clanAndHallInfo.getHall();
|
||||
ClanInfo clanInfo = clanAndHallInfo.getClan();
|
||||
boolean showApply = AuthModel.get().getCurrentUid() != userId && HallDataManager.get().getHallId() <= 0;
|
||||
if (hallInfo != null && hallInfo.getHallId() > 0) {
|
||||
mBinding.llModuleHall.setVisibility(View.VISIBLE);
|
||||
mBinding.llHall.setVisibility(View.VISIBLE);
|
||||
mBinding.tvHallId.setText("房间ID:" + hallInfo.getHallId() + "");
|
||||
mBinding.tvHallName.setText(hallInfo.getHallName());
|
||||
mBinding.tvHallMemberNum.setText("房间人数:" + hallInfo.getMemberCount());
|
||||
mBinding.tvHallErbanId.setText("大鹅号:" + hallInfo.getOwnerErbanNo());
|
||||
GlideApp.with(this)
|
||||
.load(hallInfo.getOwnerAvatar())
|
||||
.placeholder(R.drawable.default_avatar)
|
||||
.into(mBinding.ivHallAvatar);
|
||||
if (showApply) {
|
||||
mBinding.tvApplyHall.setVisibility(View.VISIBLE);
|
||||
mBinding.tvApplyHall.setOnClickListener(v -> applyJoinHall(hallInfo.getHallId()));
|
||||
} else {
|
||||
mBinding.tvApplyHall.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
mBinding.llHall.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (clanInfo != null && clanInfo.getId() > 0) {
|
||||
mBinding.llModuleHall.setVisibility(View.VISIBLE);
|
||||
mBinding.tvHallDetail.setVisibility(View.VISIBLE);
|
||||
mBinding.llClan.setVisibility(View.VISIBLE);
|
||||
mBinding.tvClanId.setText("公会ID:" + clanInfo.getId());
|
||||
mBinding.tvClanName.setText(clanInfo.getName());
|
||||
mBinding.tvClanMemberNum.setText("公会人数:" + clanInfo.getClanMemberNum());
|
||||
mBinding.tvClanHallNum.setText("房间数量:" + clanInfo.getClanHallNum());
|
||||
GlideApp.with(this)
|
||||
.load(clanInfo.getAvatar())
|
||||
.placeholder(R.drawable.default_avatar)
|
||||
.into(mBinding.ivClanAvatar);
|
||||
GlideApp.with(this)
|
||||
.load(clanInfo.getLevelIcon())
|
||||
.placeholder(R.drawable.default_cover)
|
||||
.into(mBinding.ivClanLevel);
|
||||
} else {
|
||||
mBinding.llClan.setVisibility(View.GONE);
|
||||
if (hallInfo == null || hallInfo.getHallId() <= 0) {
|
||||
mBinding.llModuleHall.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.llHall.setOnClickListener(v -> {
|
||||
if (hallInfo != null && hallInfo.getHallId() != 0) {
|
||||
ModuleHallActivity.start(context, hallInfo.getHallId(), hallInfo.getOwnerUid(), userId);
|
||||
}
|
||||
});
|
||||
mBinding.llClan.setOnClickListener(v -> {
|
||||
ModuleClanActivity.start(context, userId);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void applyJoinHall(long hallId) {
|
||||
HallModel.get().applyJoinHall(hallId)
|
||||
.compose(RxHelper.bindActivity(UserInfoActivity.this))
|
||||
.subscribe(new BeanObserver<String>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
toast(error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
toast(s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initUserDetail(UserDetailInfo.DataBean info) {
|
||||
if (info == null) {
|
||||
return;
|
||||
}
|
||||
initGiftList(info.getUserGiftWall());
|
||||
initDynamicList(info.getDynamicInfo());
|
||||
initPhoto(info.getPrivatePhoto());
|
||||
mRoomUid = info.getRoomUid();
|
||||
setWhereVisible();
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼物列表
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
private void initGiftList(List<UserDetailInfo.DataBean.UserGiftWallBean> list) {
|
||||
if (giftAdapter == null) {
|
||||
int normalDividerSize = SizeUtils.dp2px(this, 5);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
|
||||
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||
mBinding.rvGift.setLayoutManager(layoutManager);
|
||||
mBinding.rvGift.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(@NotNull Rect outRect, @NotNull View view, @NotNull RecyclerView parent, @NotNull RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
outRect.set(0, 0, normalDividerSize, 0);
|
||||
}
|
||||
});
|
||||
|
||||
if (ListUtils.isListEmpty(list)) {
|
||||
UserDetailInfo.DataBean.UserGiftWallBean giftBean = new UserDetailInfo.DataBean.UserGiftWallBean();
|
||||
giftBean.setItemType(0);
|
||||
list.add(giftBean);
|
||||
}
|
||||
|
||||
giftAdapter = new GiftAdapter(this, null);
|
||||
giftAdapter.setEnableLoadMore(false);
|
||||
mBinding.rvGift.setAdapter(giftAdapter);
|
||||
}
|
||||
giftAdapter.setNewData(list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态列表
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
private void initDynamicList(List<WorldDynamicBean> list) {
|
||||
if (dynamicAdapter == null) {
|
||||
mBinding.rvDynamic.setLayoutManager(new LinearLayoutManager(this));
|
||||
dynamicAdapter = new UserInfoDynamicAdapter(this);
|
||||
dynamicAdapter.setEnableLoadMore(false);
|
||||
dynamicAdapter.setOnItemChildClickListener((baseQuickAdapter, view, pos) -> {
|
||||
WorldDynamicBean bean = dynamicAdapter.getItem(pos);
|
||||
if (bean == null) {
|
||||
return;
|
||||
}
|
||||
if (view.getId() == R.id.iv_more) {
|
||||
List<ButtonItem> list_adapter = new ArrayList<>();
|
||||
if (!UserModel.get().isMyseft(bean.getUid())) {
|
||||
ButtonItem item = new ButtonItem("举报", () -> {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_WORLD_REPORT_MOMENTS,
|
||||
"举报动态-区分-动态广场");
|
||||
UIHelper.showReportPage(this, bean.getUid(),
|
||||
XChatConstants.REPORT_TYPE_DYNAMIC_SQUARE);
|
||||
});
|
||||
list_adapter.add(item);
|
||||
}
|
||||
if (UserModel.get().isMyseft(bean.getUid()) ||
|
||||
isThisWorldOwner(bean)) {
|
||||
ButtonItem item = new ButtonItem("删除", () -> deleteDynamic(pos, dynamicAdapter));
|
||||
list_adapter.add(item);
|
||||
}
|
||||
getDialogManager().showCommonPopupDialog(list_adapter, "取消");
|
||||
} else if (view.getId() == R.id.ll_share) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_WORLD_SHARE_MOMENTS,
|
||||
"分享动态-区分-动态广场");
|
||||
new ShareDynamicHelper(this).share(bean);
|
||||
}
|
||||
});
|
||||
mBinding.rvDynamic.setAdapter(dynamicAdapter);
|
||||
}
|
||||
dynamicAdapter.setNewData(list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 相册
|
||||
*/
|
||||
@@ -614,8 +462,6 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
break;
|
||||
|
||||
case R.id.iv_edit:
|
||||
|
||||
case R.id.tv_edit:
|
||||
editClick(identityState);
|
||||
break;
|
||||
|
||||
@@ -666,17 +512,13 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
PraiseModel.get().praise(userInfo.getUid(), true).subscribe();
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.tv_gift_detail:
|
||||
startActivity(new Intent(this, UserGiftActivity.class));
|
||||
break;
|
||||
case R.id.iv_where:
|
||||
if (userInfo == null) {
|
||||
toast("用户信息为空。");
|
||||
return;
|
||||
}
|
||||
if (mRoomUid != 0) {
|
||||
AVRoomActivity.startForFromType(this, mRoomUid,
|
||||
if (viewModel.getMRoomUid() != 0) {
|
||||
AVRoomActivity.startForFromType(this, viewModel.getMRoomUid(),
|
||||
AVRoomActivity.FROM_TYPE_USER, userInfo.getNick(), String.valueOf(userInfo.getUid()));
|
||||
}
|
||||
break;
|
||||
@@ -749,46 +591,6 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
StatusBarUtil.StatusBarLightMode(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断自己是不是该世界的创始人
|
||||
*/
|
||||
private boolean isThisWorldOwner(WorldDynamicBean bean) {
|
||||
return bean != null && bean.getWorldUid() == AuthModel.get().getCurrentUid();
|
||||
}
|
||||
|
||||
private void deleteDynamic(int pos, UserInfoDynamicAdapter adapter) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_WORLD_DELETE_MOMENTS,
|
||||
"删除动态-区分-动态广场");
|
||||
getDialogManager().showOkCancelWithTitleDialog("删除后不可恢复,确定删除该动态吗?",
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
WorldDynamicBean bean = adapter.getItem(pos);
|
||||
if (bean == null) {
|
||||
return;
|
||||
}
|
||||
DynamicModel.get().delete(bean.getWorldId(), bean.getDynamicId())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(new DontWarnObserver<String>() {
|
||||
@Override
|
||||
public void accept(String s, String error) {
|
||||
super.accept(s, error);
|
||||
if (error != null) {
|
||||
toast(error);
|
||||
} else {
|
||||
toast("删除成功");
|
||||
if (pos < adapter.getData().size()) {
|
||||
if (Objects.equals(bean, adapter.getItem(pos))) {
|
||||
adapter.remove(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface IdentityState {
|
||||
int NON = 0; // 无法识别
|
||||
|
@@ -0,0 +1,39 @@
|
||||
package com.yizhuan.erban.ui.user.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.user.GradientDrawableCreator
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
|
||||
|
||||
class SkillCardAdapter(private val context: Context) :
|
||||
BaseQuickAdapter<UserInfoSkillEntity, BaseViewHolder>(R.layout.item_userinfo_skill) {
|
||||
private val buffer = StringBuffer()
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: UserInfoSkillEntity?) {
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_icon), item?.icon)
|
||||
helper.setText(R.id.tv_title, item?.name ?: "")
|
||||
buffer.delete(0, buffer.length)
|
||||
item?.propVals?.let {
|
||||
for ((index, v) in it.withIndex()) {
|
||||
buffer.append(v).append(if (index != it.size - 1) "/" else "")
|
||||
}
|
||||
}
|
||||
helper.setText(R.id.tv_desc, buffer.toString())
|
||||
val radius = UIUtil.dip2px(context, 8.0)
|
||||
val drawable = when (item?.cardId) {
|
||||
1 -> GradientDrawableCreator.createDrawable(radius, Color.parseColor("#EEF2FF"))
|
||||
2 -> GradientDrawableCreator.createDrawable(radius, Color.parseColor("#FEF5E8"))
|
||||
3 -> GradientDrawableCreator.createDrawable(radius, Color.parseColor("#F9ECFF"))
|
||||
4 -> GradientDrawableCreator.createDrawable(radius, Color.parseColor("#E9FFF4"))
|
||||
5 -> GradientDrawableCreator.createDrawable(radius, Color.parseColor("#F2FFE0"))
|
||||
6 -> GradientDrawableCreator.createDrawable(radius, Color.parseColor("#FFE7EF"))
|
||||
else -> GradientDrawableCreator.createDrawable(radius, Color.parseColor("#FFE4FB"))
|
||||
}
|
||||
helper.itemView.background = drawable
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.yizhuan.erban.ui.user.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
|
||||
class SkillPicsAdapter: BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_userinfo_skill_abspicture) {
|
||||
override fun convert(helper: BaseViewHolder, item: String) {
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_skill_picture),item)
|
||||
}
|
||||
}
|
@@ -0,0 +1,110 @@
|
||||
package com.yizhuan.erban.ui.user.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.Gravity;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
private final Context mContext;
|
||||
private final List<? extends CharSequence> mTitleList;
|
||||
|
||||
private int textSize = 16;
|
||||
private float minScale = 0.75f;
|
||||
private boolean showIndicator =true;
|
||||
|
||||
public UserInfoIndicatorAdapter(Context context, List<? extends CharSequence> charSequences ) {
|
||||
this.mContext = context;
|
||||
this.mTitleList = charSequences;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mTitleList == null ? 0 : mTitleList.size();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int i) {
|
||||
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
|
||||
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context,R.color.color_40_333333));
|
||||
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context,R.color.color_333333));
|
||||
scaleTransitionPagerTitleView.setMinScale(minScale);
|
||||
scaleTransitionPagerTitleView.setTextSize(textSize);
|
||||
int padding = UIUtil.dip2px(context, 18);
|
||||
scaleTransitionPagerTitleView.setPadding(padding, 0, padding, 0);
|
||||
scaleTransitionPagerTitleView.setText(mTitleList.get(i));
|
||||
scaleTransitionPagerTitleView.setOnClickListener(view -> {
|
||||
if (mOnItemSelectListener != null) {
|
||||
mOnItemSelectListener.onItemSelect(i, scaleTransitionPagerTitleView);
|
||||
}
|
||||
|
||||
});
|
||||
return scaleTransitionPagerTitleView;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
if (!showIndicator) return null;
|
||||
LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
|
||||
indicator.setLineHeight(UIUtil.dip2px(mContext, 10));
|
||||
indicator.setRoundRadius(UIUtil.dip2px(mContext, 7));
|
||||
indicator.setLineWidth(UIUtil.dip2px(mContext, 41));
|
||||
indicator.setColors(Color.parseColor("#FFC000"));
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
lp.gravity = Gravity.END;
|
||||
lp.bottomMargin = UIUtil.dip2px(mContext, 0);
|
||||
indicator.setLayoutParams(lp);
|
||||
return indicator;
|
||||
}
|
||||
|
||||
public int getTextSize() {
|
||||
return textSize;
|
||||
}
|
||||
|
||||
public void setTextSize(int textSize) {
|
||||
this.textSize = textSize;
|
||||
}
|
||||
|
||||
public float getMinScale() {
|
||||
return minScale;
|
||||
}
|
||||
|
||||
public void setMinScale(float minScale) {
|
||||
this.minScale = minScale;
|
||||
}
|
||||
|
||||
public boolean isShowIndicator() {
|
||||
return showIndicator;
|
||||
}
|
||||
|
||||
public void setShowIndicator(boolean showIndicator) {
|
||||
this.showIndicator = showIndicator;
|
||||
}
|
||||
|
||||
private OnItemSelectListener mOnItemSelectListener;
|
||||
|
||||
public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) {
|
||||
mOnItemSelectListener = onItemSelectListener;
|
||||
}
|
||||
|
||||
public interface OnItemSelectListener {
|
||||
void onItemSelect(int position, TextView view);
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.yizhuan.erban.ui.user.adapter
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentPagerAdapter
|
||||
|
||||
class UserInfoPagerAdapter(fm:FragmentManager,private val list:List<Fragment>) :FragmentPagerAdapter(fm,
|
||||
BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT){
|
||||
override fun getCount()=list.size
|
||||
|
||||
override fun getItem(position: Int)=list[position]
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
package com.yizhuan.erban.ui.user.decorationsend
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Rect
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
|
||||
class UserInfoSkillDecoration(context: Context, space: Int) : RecyclerView.ItemDecoration() {
|
||||
private val spaceDp = UIUtil.dip2px(context, space.toDouble())
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
val position = parent.getChildAdapterPosition(view)
|
||||
val count = parent.adapter?.itemCount ?: 0
|
||||
when (position) {
|
||||
0 -> outRect.right = spaceDp / 2
|
||||
count - 1 -> outRect.left = spaceDp / 2
|
||||
else -> {
|
||||
outRect.right = spaceDp / 2
|
||||
outRect.left = spaceDp / 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,125 @@
|
||||
package com.yizhuan.erban.ui.user.view
|
||||
|
||||
import android.view.View
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.UIHelper
|
||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager.OkCancelDialogListener
|
||||
import com.yizhuan.erban.community.helper.ShareDynamicHelper
|
||||
import com.yizhuan.erban.databinding.FragmentUserinfoDynamicBinding
|
||||
import com.yizhuan.erban.ui.user.adapter.UserInfoDynamicAdapter
|
||||
import com.yizhuan.erban.ui.user.viewmodel.UserInfoViewModel
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants
|
||||
import com.yizhuan.xchat_android_core.community.bean.WorldDynamicBean
|
||||
import com.yizhuan.xchat_android_core.community.dynamic.DynamicModel
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import java.util.ArrayList
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
|
||||
@ActLayoutRes(R.layout.fragment_userinfo_dynamic)
|
||||
class UserInfoDynamicFragment : BaseViewBindingFragment<FragmentUserinfoDynamicBinding>() {
|
||||
private val vm by activityViewModels<UserInfoViewModel>()
|
||||
private var dynamicAdapter: UserInfoDynamicAdapter? = null
|
||||
override fun init() {
|
||||
vm.userInfoDetailData.observe(this, Observer { dataBean: UserDetailInfo.DataBean ->
|
||||
initDynamicList(dataBean.dynamicInfo)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态列表
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
private fun initDynamicList(list: List<WorldDynamicBean>) {
|
||||
if (dynamicAdapter == null) {
|
||||
binding.rvDynamic.layoutManager = LinearLayoutManager(mContext)
|
||||
dynamicAdapter = UserInfoDynamicAdapter(mContext)
|
||||
dynamicAdapter?.setEnableLoadMore(false)
|
||||
dynamicAdapter?.setOnItemChildClickListener { _, view: View, pos: Int ->
|
||||
val bean: WorldDynamicBean =
|
||||
dynamicAdapter?.getItem(pos) ?: return@setOnItemChildClickListener
|
||||
if (view.id == R.id.iv_more) {
|
||||
val dataList: MutableList<ButtonItem> =
|
||||
ArrayList()
|
||||
if (!UserModel.get().isMyseft(bean.getUid())) {
|
||||
val item = ButtonItem("举报") {
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_WORLD_REPORT_MOMENTS,
|
||||
"举报动态-区分-动态广场"
|
||||
)
|
||||
UIHelper.showReportPage(
|
||||
mContext, bean.getUid(),
|
||||
XChatConstants.REPORT_TYPE_DYNAMIC_SQUARE
|
||||
)
|
||||
}
|
||||
dataList.add(item)
|
||||
}
|
||||
if (UserModel.get().isMyseft(bean.getUid()) ||
|
||||
isThisWorldOwner(bean)
|
||||
) {
|
||||
val item = ButtonItem(
|
||||
"删除"
|
||||
) { deleteDynamic(pos, dynamicAdapter) }
|
||||
dataList.add(item)
|
||||
}
|
||||
dialogManager.showCommonPopupDialog(dataList, "取消")
|
||||
} else if (view.id == R.id.ll_share) {
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_WORLD_SHARE_MOMENTS,
|
||||
"分享动态-区分-动态广场"
|
||||
)
|
||||
ShareDynamicHelper(activity).share(bean)
|
||||
}
|
||||
}
|
||||
binding.rvDynamic.setAdapter(dynamicAdapter)
|
||||
}
|
||||
dynamicAdapter?.setNewData(list)
|
||||
}
|
||||
|
||||
|
||||
private fun deleteDynamic(pos: Int, adapter: UserInfoDynamicAdapter?) {
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_WORLD_DELETE_MOMENTS,
|
||||
"删除动态-区分-动态广场"
|
||||
)
|
||||
dialogManager.showOkCancelWithTitleDialog("删除后不可恢复,确定删除该动态吗?",
|
||||
OkCancelDialogListener {
|
||||
val bean = adapter?.getItem(pos) ?: return@OkCancelDialogListener
|
||||
DynamicModel.get().delete(bean.getWorldId(), bean.getDynamicId())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe(object : DontWarnObserver<String?>() {
|
||||
override fun accept(s: String?, error: String) {
|
||||
super.accept(s, error)
|
||||
if (error != null) {
|
||||
toast(error)
|
||||
} else {
|
||||
toast("删除成功")
|
||||
if (pos < adapter.data.size) {
|
||||
if (bean == adapter.getItem(pos)) {
|
||||
adapter.remove(pos)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断自己是不是该世界的创始人
|
||||
*/
|
||||
private fun isThisWorldOwner(bean: WorldDynamicBean?): Boolean {
|
||||
return bean != null && bean.getWorldUid() === AuthModel.get().getCurrentUid()
|
||||
}
|
||||
}
|
@@ -0,0 +1,225 @@
|
||||
package com.yizhuan.erban.ui.user.view
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.ItemDecoration
|
||||
import com.netease.nim.uikit.support.glide.GlideApp
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.databinding.FragmentUserinfoUserinfoBinding
|
||||
import com.yizhuan.erban.module_hall.HallDataManager
|
||||
import com.yizhuan.erban.skill.activity.ActivitySkillHome
|
||||
import com.yizhuan.erban.skill.activity.SkillDetailActivity
|
||||
import com.yizhuan.erban.ui.user.UserGiftActivity
|
||||
import com.yizhuan.erban.ui.user.adapter.GiftAdapter
|
||||
import com.yizhuan.erban.ui.user.adapter.SkillCardAdapter
|
||||
import com.yizhuan.erban.ui.user.decorationsend.UserInfoSkillDecoration
|
||||
import com.yizhuan.erban.ui.user.viewmodel.UserInfoViewModel
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.AuthInfo
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanAndHallInfo
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanInfo
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.HallInfo
|
||||
import com.yizhuan.xchat_android_core.user.UserInfoUiMgr
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo.DataBean.UserGiftWallBean
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||
|
||||
@ActLayoutRes(R.layout.fragment_userinfo_userinfo)
|
||||
class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBinding>(),
|
||||
View.OnClickListener {
|
||||
|
||||
private var giftAdapter: GiftAdapter? = null
|
||||
private var skillAdapter: SkillCardAdapter? = null
|
||||
private val vm: UserInfoViewModel by activityViewModels()
|
||||
private fun initClanAndHall(clanAndHallInfo: ClanAndHallInfo) {
|
||||
val hallInfo: HallInfo = clanAndHallInfo.hall
|
||||
val clanInfo: ClanInfo = clanAndHallInfo.clan
|
||||
val showApply =
|
||||
AuthModel.get().currentUid != vm.userId && HallDataManager.get().hallId <= 0
|
||||
if (hallInfo != null && hallInfo.hallId > 0) {
|
||||
binding.llModuleHall.visibility = View.VISIBLE
|
||||
binding.llHall.visibility = View.VISIBLE
|
||||
binding.tvHallId.text = "房间ID:" + hallInfo.getHallId().toString() + ""
|
||||
binding.tvHallName.text = hallInfo.hallName
|
||||
binding.tvHallMemberNum.text = "房间人数:" + hallInfo.memberCount
|
||||
binding.tvHallErbanId.text = "大鹅号:" + hallInfo.ownerErbanNo
|
||||
GlideApp.with(this)
|
||||
.load(hallInfo.ownerAvatar)
|
||||
.placeholder(R.drawable.default_avatar)
|
||||
.into(binding.ivHallAvatar)
|
||||
if (showApply) {
|
||||
binding.tvApplyHall.visibility = View.VISIBLE
|
||||
binding.tvApplyHall.setOnClickListener { v -> applyJoinHall(hallInfo.hallId) }
|
||||
} else {
|
||||
binding.tvApplyHall.visibility = View.GONE
|
||||
}
|
||||
} else {
|
||||
binding.llHall.visibility = View.GONE
|
||||
}
|
||||
|
||||
if (clanInfo != null && clanInfo.getId() > 0) {
|
||||
binding.llModuleHall.visibility = View.VISIBLE
|
||||
binding.tvHallDetail.visibility = View.VISIBLE
|
||||
binding.llClan.visibility = View.VISIBLE
|
||||
binding.tvClanId.text = "公会ID:" + clanInfo.getId()
|
||||
binding.tvClanName.setText(clanInfo.getName())
|
||||
binding.tvClanMemberNum.text = "公会人数:" + clanInfo.clanMemberNum
|
||||
binding.tvClanHallNum.text = "房间数量:" + clanInfo.clanHallNum
|
||||
GlideApp.with(this)
|
||||
.load(clanInfo.getAvatar())
|
||||
.placeholder(R.drawable.default_avatar)
|
||||
.into(binding.ivClanAvatar)
|
||||
GlideApp.with(this)
|
||||
.load(clanInfo.getLevelIcon())
|
||||
.placeholder(R.drawable.default_cover)
|
||||
.into(binding.ivClanLevel)
|
||||
} else {
|
||||
binding.llClan.visibility = View.GONE
|
||||
if (hallInfo == null || hallInfo.getHallId() <= 0) {
|
||||
binding.llModuleHall.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼物列表
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
private fun initGiftList(list: MutableList<UserGiftWallBean?>) {
|
||||
if (giftAdapter == null) {
|
||||
val layoutManager = GridLayoutManager(context, 4)
|
||||
layoutManager.orientation = LinearLayoutManager.HORIZONTAL
|
||||
binding.rvGift.layoutManager = layoutManager
|
||||
binding.rvGift.addItemDecoration(object : ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
outRect.bottom = UIUtil.dip2px(context, 12.0)
|
||||
val position = parent.getChildAdapterPosition(view)
|
||||
val space = UIUtil.dip2px(context, 40.0)
|
||||
val margin = UIUtil.dip2px(context, 15.0)
|
||||
when (position) {
|
||||
0 -> {
|
||||
outRect.left = margin
|
||||
outRect.right = space / 2
|
||||
}
|
||||
1, 2 -> {
|
||||
outRect.left = space / 2
|
||||
outRect.right = space / 2
|
||||
}
|
||||
3 -> {
|
||||
outRect.left = space / 2
|
||||
outRect.right = margin
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
if (ListUtils.isListEmpty(list)) {
|
||||
val giftBean = UserGiftWallBean()
|
||||
giftBean.itemType = 0
|
||||
list.add(giftBean)
|
||||
}
|
||||
giftAdapter = GiftAdapter(context, null)
|
||||
giftAdapter?.setEnableLoadMore(false)
|
||||
binding.rvGift.adapter = giftAdapter
|
||||
}
|
||||
giftAdapter?.setNewData(list)
|
||||
}
|
||||
|
||||
/**
|
||||
* 技能卡
|
||||
*/
|
||||
private fun initSkillCardList(list: List<UserInfoSkillEntity>) {
|
||||
if (skillAdapter == null) {
|
||||
skillAdapter = SkillCardAdapter(mContext)
|
||||
skillAdapter?.setHeaderAndEmpty(true)
|
||||
skillAdapter?.setOnItemClickListener { _, _, _ ->
|
||||
val type = if (vm.userId == AuthModel.get().currentUid) 0 else 1
|
||||
ActivitySkillHome.start(mContext, type)
|
||||
}
|
||||
binding.recyclerSkill.addItemDecoration(UserInfoSkillDecoration(mContext, 8))
|
||||
binding.recyclerSkill.layoutManager =
|
||||
LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)
|
||||
binding.recyclerSkill.adapter = skillAdapter
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
skillAdapter?.setNewData(ArrayList(0))
|
||||
skillAdapter?.emptyView = createSkillEmptyView()
|
||||
} else {
|
||||
skillAdapter?.setNewData(list)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.tv_gift_detail -> startActivity(Intent(mContext, UserGiftActivity::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyJoinHall(hallId: Long) {
|
||||
HallModel.get().applyJoinHall(hallId)
|
||||
.compose(RxHelper.bindFragment(this))
|
||||
.subscribe(object : BeanObserver<String?>() {
|
||||
override fun onErrorMsg(error: String) {
|
||||
toast(error)
|
||||
}
|
||||
|
||||
override fun onSuccess(s: String) {
|
||||
toast(s)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun createSkillEmptyView(): View {
|
||||
val textView = TextView(mContext)
|
||||
val textViewHeight = UIUtil.dip2px(mContext, 47.0)
|
||||
textView.layoutParams =
|
||||
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, textViewHeight)
|
||||
textView.gravity = Gravity.CENTER
|
||||
textView.setTextColor(mContext.resources.getColor(R.color.color_666666))
|
||||
textView.text = "还未添加技能卡喔"
|
||||
textView.textSize = 12.0f
|
||||
val conner = UIUtil.dip2px(mContext, 8.0)
|
||||
val drawable = GradientDrawable()
|
||||
drawable.cornerRadius = conner.toFloat()
|
||||
drawable.setColor(Color.parseColor("#F4F7FF"))
|
||||
textView.background = drawable
|
||||
return textView
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
vm.userInfoDetailData.observe(this) {
|
||||
initGiftList(it.userGiftWall)
|
||||
}
|
||||
vm.hallData.observe(this) {
|
||||
initClanAndHall(it)
|
||||
}
|
||||
vm.userInfoSkillData.observe(this) {
|
||||
initSkillCardList(it)
|
||||
}
|
||||
binding.tvGiftDetail.setOnClickListener(this)
|
||||
|
||||
vm.getUserSkillData()
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
package com.yizhuan.erban.ui.user.viewmodel
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.yizhuan.erban.skill.repository.SkillModel
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanAndHallInfo
|
||||
import com.yizhuan.xchat_android_core.user.UserInfoUiMgr
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
|
||||
class UserInfoViewModel : ViewModel() {
|
||||
val userId: Long by lazy {
|
||||
UserInfoUiMgr.get().uid
|
||||
}
|
||||
val userInfoDetailData: MutableLiveData<UserDetailInfo.DataBean> by lazy {
|
||||
MutableLiveData()
|
||||
}
|
||||
|
||||
val userInfoSkillData: MutableLiveData<List<UserInfoSkillEntity>> by lazy {
|
||||
MutableLiveData()
|
||||
}
|
||||
|
||||
val hallData: MutableLiveData<ClanAndHallInfo> by lazy {
|
||||
MutableLiveData()
|
||||
}
|
||||
var mRoomUid: Long = 0
|
||||
|
||||
fun getUserInfoDetail() {
|
||||
UserModel.get().getUserInfoDetail(userId)
|
||||
.subscribe(object : BeanObserver<UserDetailInfo?>() {
|
||||
override fun onErrorMsg(error: String) {}
|
||||
override fun onSuccess(info: UserDetailInfo) {
|
||||
info.let {
|
||||
userInfoDetailData.value = it.data
|
||||
mRoomUid = it.data.roomUid
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun getUserHallAndClan() {
|
||||
HallModel.get().getUserHallAndClan(userId)
|
||||
.subscribe(
|
||||
{ data -> data?.let { hallData.value = data } },
|
||||
{ th -> th.printStackTrace() })
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun getUserSkillData() {
|
||||
SkillModel.instance.getUserInfoSkillList()
|
||||
.subscribe({
|
||||
userInfoSkillData.value = it
|
||||
}, { th ->
|
||||
th.printStackTrace()
|
||||
})
|
||||
}
|
||||
}
|
@@ -17,6 +17,7 @@ import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatDialog;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.flexbox.FlexboxLayout;
|
||||
@@ -33,7 +34,11 @@ import com.yizhuan.erban.avroom.ktv.KtvMusicManager;
|
||||
import com.yizhuan.erban.avroom.widget.ViewItem;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.ui.user.UserInfoActivity;
|
||||
import com.yizhuan.erban.ui.user.adapter.SkillPicsAdapter;
|
||||
import com.yizhuan.erban.ui.user.decorationsend.UserInfoSkillDecoration;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.SpacingDecoration;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.erban.vip.VipHelper;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
@@ -157,6 +162,9 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
private TextView tvSelectHim;
|
||||
private View attentView;
|
||||
private String avatarBg;
|
||||
private SkillPicsAdapter picsAdapter;
|
||||
|
||||
private RecyclerView recyclerViewSkill;
|
||||
|
||||
public UserInfoDialog(Context context, long uid, List<ViewItem> buttons, boolean isInRoom) {
|
||||
super(context, R.style.ErbanUserInfoDialog);
|
||||
@@ -215,6 +223,12 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
tvSelectHim = findViewById(R.id.tv_select_him);
|
||||
avatarLayout.setOnClickListener(this);
|
||||
closeImage.setOnClickListener(this);
|
||||
|
||||
recyclerViewSkill = findViewById(R.id.recyclerview_skill_card);
|
||||
picsAdapter = new SkillPicsAdapter();
|
||||
recyclerViewSkill.setAdapter(picsAdapter);
|
||||
recyclerViewSkill.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
|
||||
recyclerViewSkill.addItemDecoration(new UserInfoSkillDecoration(context,8));
|
||||
TextView tvReport = findViewById(R.id.tv_report);
|
||||
if (tvReport != null) {
|
||||
if (isMySelf) {
|
||||
@@ -586,6 +600,13 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
}
|
||||
if (userInfo.getAbsCardPics() == null)
|
||||
{
|
||||
recyclerViewSkill.setVisibility(View.GONE);
|
||||
}else{
|
||||
recyclerViewSkill.setVisibility(View.VISIBLE);
|
||||
picsAdapter.setNewData(userInfo.getAbsCardPics());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_skill_guide.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_skill_guide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
12
app/src/main/res/drawable/bg_f7e8c4_f7ddbf_20.xml
Normal file
12
app/src/main/res/drawable/bg_f7e8c4_f7ddbf_20.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#F7E8C4"
|
||||
android:startColor="#F7DDBF" />
|
||||
|
||||
<corners android:radius="@dimen/dp_20" />
|
||||
|
||||
</shape>
|
@@ -47,7 +47,7 @@
|
||||
android:drawableRight="@mipmap/arrow_right_2"
|
||||
android:drawablePadding="9dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="赛事记录"
|
||||
android:text="赛事奖金"
|
||||
android:onClick="@{click}"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
|
@@ -36,7 +36,7 @@
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginBottom="61dp"
|
||||
android:background="@drawable/bg_ffcb47_ffa936_20"
|
||||
android:background="@drawable/bg_f7e8c4_f7ddbf_20"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:text="@string/delete_skill"
|
||||
@@ -49,7 +49,7 @@
|
||||
android:id="@+id/btn_save"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/bg_ffd2d5d7_20"
|
||||
android:background="@drawable/common_btn_bg"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:text="@string/save"
|
||||
|
@@ -252,337 +252,20 @@
|
||||
android:textSize="@dimen/dp_11"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_id"
|
||||
tools:text="喜欢我就关注我" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_module_hall"
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
/>
|
||||
<com.yizhuan.erban.ui.widget.ContentWrapViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:text="所属公会"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_clan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_5"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.yizhuan.erban.common.widget.RectRoundImageView
|
||||
android:id="@+id/iv_clan_avatar"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="8dp"
|
||||
app:type="round" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:lines="1"
|
||||
android:maxLength="9"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="@dimen/dp_16"
|
||||
tools:text="忘忧忘忧忘忧忘忧阁忘忧阁阁阁忘忧阁阁" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="公会ID:123456" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_member_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="公会人数:123" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_hall_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="公会数量:123" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_clan_level"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/arrow_right"
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_hall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_only_hall_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:text="所属房间"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<com.yizhuan.erban.common.widget.RectRoundImageView
|
||||
android:id="@+id/iv_hall_avatar"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="8dp"
|
||||
app:type="round" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:lines="1"
|
||||
android:maxLength="9"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="@dimen/dp_16"
|
||||
tools:text="忘忘忧忘忘忧阁忘忧阁忧阁阁忘忧阁忧阁" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="公会ID:123456" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_erban_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="大鹅号:1234567" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_member_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="房间人数:123" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_apply_hall"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/shape_stroke_app_color_1dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="申请加入"
|
||||
android:textColor="@color/app_248cfe"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableEnd="@drawable/arrow_right"
|
||||
android:padding="@dimen/dp_15"
|
||||
android:text="礼物"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dynamic_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:text="动态"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_dynamic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<ViewStub
|
||||
|
@@ -326,6 +326,15 @@
|
||||
android:background="@drawable/bg_user_info_dialog_bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:id="@+id/recyclerview_skill_card"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_grid_button"
|
||||
android:layout_width="match_parent"
|
||||
|
File diff suppressed because it is too large
Load Diff
37
app/src/main/res/layout/fragment_userinfo_dynamic.xml
Normal file
37
app/src/main/res/layout/fragment_userinfo_dynamic.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/ll_dynamic_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:text="动态"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_dynamic"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</layout>
|
343
app/src/main/res/layout/fragment_userinfo_info.xml
Normal file
343
app/src/main/res/layout/fragment_userinfo_info.xml
Normal file
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_module_hall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:text="所属公会"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_clan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_5"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.yizhuan.erban.common.widget.RectRoundImageView
|
||||
android:id="@+id/iv_clan_avatar"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="8dp"
|
||||
app:type="round" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:lines="1"
|
||||
android:maxLength="9"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="@dimen/dp_16"
|
||||
tools:text="忘忧忘忧忘忧忘忧阁忘忧阁阁阁忘忧阁阁" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="公会ID:123456" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_member_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="公会人数:123" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_hall_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="公会数量:123" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_clan_level"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/arrow_right"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_hall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_only_hall_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:text="所属房间"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<com.yizhuan.erban.common.widget.RectRoundImageView
|
||||
android:id="@+id/iv_hall_avatar"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="8dp"
|
||||
app:type="round" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:lines="1"
|
||||
android:maxLength="9"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="@dimen/dp_16"
|
||||
tools:text="忘忘忧忘忘忧阁忘忧阁忧阁阁忘忧阁忧阁" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="公会ID:123456" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_erban_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="大鹅号:1234567" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_member_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="房间人数:123" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_apply_hall"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/shape_stroke_app_color_1dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="申请加入"
|
||||
android:textColor="@color/app_248cfe"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_skill_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/dp_12"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_module_hall"
|
||||
app:layout_goneMarginTop="@dimen/dp_14"
|
||||
android:background="@drawable/bg_secondary_radius_10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="技能卡"
|
||||
android:drawableRight="@drawable/arrow_right"
|
||||
android:textColor="@color/color_333333"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/recycler_skill_card"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
tools:layout_height="@dimen/dp_50"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_skill_card"
|
||||
app:layout_goneMarginTop="@dimen/dp_14">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableEnd="@drawable/arrow_right"
|
||||
android:padding="@dimen/dp_15"
|
||||
android:text="礼物"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</layout>
|
329
app/src/main/res/layout/fragment_userinfo_userinfo.xml
Normal file
329
app/src/main/res/layout/fragment_userinfo_userinfo.xml
Normal file
@@ -0,0 +1,329 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_module_hall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:text="所属公会"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_clan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_5"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.yizhuan.erban.common.widget.RectRoundImageView
|
||||
android:id="@+id/iv_clan_avatar"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="8dp"
|
||||
app:type="round" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:lines="1"
|
||||
android:maxLength="9"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="@dimen/dp_16"
|
||||
tools:text="忘忧忘忧忘忧忘忧阁忘忧阁阁阁忘忧阁阁" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="公会ID:123456" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_member_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="公会人数:123" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clan_hall_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="公会数量:123" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_clan_level"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/arrow_right"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_hall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_only_hall_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:text="所属房间"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<com.yizhuan.erban.common.widget.RectRoundImageView
|
||||
android:id="@+id/iv_hall_avatar"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="8dp"
|
||||
app:type="round" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:lines="1"
|
||||
android:maxLength="9"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="@dimen/dp_16"
|
||||
tools:text="忘忘忧忘忘忧阁忘忧阁忧阁阁忘忧阁忧阁" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="公会ID:123456" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_erban_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="大鹅号:1234567" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_member_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="房间人数:123" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_apply_hall"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/shape_stroke_app_color_1dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="申请加入"
|
||||
android:textColor="@color/app_248cfe"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_skill"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_module_hall"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg_corner_shadow_12"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/dp_12"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
app:layout_goneMarginTop="0dp"
|
||||
android:paddingRight="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:paddingBottom="@dimen/dp_12">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:text="技能卡"
|
||||
android:textColor="@color/color_333333"
|
||||
/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/recycler_skill"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_skill"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="296dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@drawable/bg_secondary_radius_10"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableEnd="@drawable/arrow_right"
|
||||
android:padding="@dimen/dp_15"
|
||||
android:text="礼物墙"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:background="@drawable/bg_corner_shadow_12"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingBottom="5dp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -1,35 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/ic_user_gift_empty"
|
||||
/>
|
||||
android:src="@mipmap/ic_user_gift_empty" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:text="还没收到礼物"
|
||||
android:textColor="@color/appColor"
|
||||
android:textSize="@dimen/sp_10"
|
||||
|
||||
android:padding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="-5dp"
|
||||
android:background="@drawable/bg_user_gift_count"
|
||||
/>
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:padding="@dimen/dp_2"
|
||||
android:text="还没收到礼物"
|
||||
android:textColor="@color/appColor"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
|
||||
</LinearLayout>
|
44
app/src/main/res/layout/item_userinfo_skill.xml
Normal file
44
app/src/main/res/layout/item_userinfo_skill.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
android:paddingBottom="@dimen/dp_8"
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@id/iv_icon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="英雄联盟手游" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
tools:text="英雄联盟手游" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/iv_skill_picture"
|
||||
android:layout_height="@dimen/dp_20"/>
|
@@ -30,6 +30,7 @@
|
||||
android:ellipsize="end"
|
||||
android:gravity="right|center_vertical"
|
||||
android:maxWidth="130dp"
|
||||
android:maxLength="30"
|
||||
android:maxLines="2"
|
||||
android:minWidth="@dimen/dp_60"
|
||||
android:textColor="@color/color_333333"
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 0 B |
@@ -358,6 +358,7 @@
|
||||
<color name="color_FFC4AB">#FFC4AB</color>
|
||||
|
||||
<color name="color_33000000">#33000000</color>
|
||||
<color name="color_30000000">#30000000</color>
|
||||
<color name="color_66000000">#66000000</color>
|
||||
<color name="color_4D000000">#4D000000</color>
|
||||
<color name="color_40FFFFFF">#40FFFFFF</color>
|
||||
@@ -595,4 +596,7 @@
|
||||
<color name="color_60_FFFFFF">#99FFFFFF</color>
|
||||
<color name="color_10_FFFFFF">#1AFFFFFF</color>
|
||||
|
||||
|
||||
<color name="color_40_333333">#66333333</color>
|
||||
|
||||
</resources>
|
||||
|
@@ -96,6 +96,10 @@ public class UserInfo implements Serializable {
|
||||
//个人相册
|
||||
private List<UserPhoto> privatePhoto;
|
||||
private ArrayList<JoinWorldInfo> joinWorlds;
|
||||
//技能卡
|
||||
@Getter
|
||||
@Setter
|
||||
private List<String> absCardPics;
|
||||
@Getter
|
||||
@Setter
|
||||
private int registerDay;
|
||||
|
@@ -0,0 +1,26 @@
|
||||
package com.yizhuan.xchat_android_core.user.bean
|
||||
|
||||
/**
|
||||
* {
|
||||
"code": 0,
|
||||
"data": [
|
||||
{
|
||||
"colorType": 0,
|
||||
"icon": "string",
|
||||
"id": 0,
|
||||
"name": "string",
|
||||
"propVals": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"message": "string"
|
||||
}
|
||||
*/
|
||||
data class UserInfoSkillEntity(
|
||||
val cardId: Int,
|
||||
val icon: String?,
|
||||
val id: Int,
|
||||
val name: String,
|
||||
val propVals: List<String>
|
||||
)
|
Reference in New Issue
Block a user