|
|
@@ -7,6 +7,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
import com.adealink.frame.base.fastLazy
|
|
|
import com.adealink.frame.router.Router
|
|
|
+import com.adealink.weparty.commonui.ext.show
|
|
|
import com.adealink.weparty.commonui.recycleview.adapter.BindingViewHolder
|
|
|
import com.adealink.weparty.commonui.recycleview.adapter.MultiTypeListAdapter
|
|
|
import com.adealink.weparty.commonui.recycleview.adapter.multitype.ItemViewBinder
|
|
|
@@ -26,10 +27,16 @@ import com.adealink.weparty.profile.userprofile.data.ProfileSectionEmptyData
|
|
|
import com.adealink.weparty.profile.userprofile.listener.IUserGoodItemListener
|
|
|
import com.adealink.weparty.profile.userprofile.view.ProfileSectionEmptyViewBinder
|
|
|
|
|
|
-class ProfileAvatarFrameViewBinder(private val userGoodItemListener: IUserGoodItemListener, private val fragmentManager: FragmentManager?) :
|
|
|
+class ProfileAvatarFrameViewBinder(
|
|
|
+ private val userUid: Long,
|
|
|
+ private val userGoodItemListener: IUserGoodItemListener,
|
|
|
+ private val fragmentManager: FragmentManager?
|
|
|
+) :
|
|
|
ItemViewBinder<ProfileAvatarFrameData,
|
|
|
ProfileAvatarFrameViewBinder.ViewHolder>(), IUserGoodItemListener {
|
|
|
|
|
|
+ val isSelf by fastLazy { userUid == ProfileModule.getMyUid() }
|
|
|
+
|
|
|
inner class ViewHolder(binding: LayoutProfileAvatarFrameBinding) :
|
|
|
BindingViewHolder<LayoutProfileAvatarFrameBinding>(binding) {
|
|
|
private val avatarFrameListAdapter by fastLazy {
|
|
|
@@ -41,7 +48,12 @@ class ProfileAvatarFrameViewBinder(private val userGoodItemListener: IUserGoodIt
|
|
|
}
|
|
|
|
|
|
private fun initViews() {
|
|
|
- avatarFrameListAdapter.register(ProfileAvatarFrameItemViewBinder(userGoodItemListener, fragmentManager))
|
|
|
+ avatarFrameListAdapter.register(
|
|
|
+ ProfileAvatarFrameItemViewBinder(
|
|
|
+ userGoodItemListener,
|
|
|
+ fragmentManager
|
|
|
+ )
|
|
|
+ )
|
|
|
avatarFrameListAdapter.register(ProfileSectionEmptyViewBinder())
|
|
|
|
|
|
binding.rvFrame.apply {
|
|
|
@@ -65,9 +77,10 @@ class ProfileAvatarFrameViewBinder(private val userGoodItemListener: IUserGoodIt
|
|
|
}
|
|
|
}
|
|
|
avatarFrameListAdapter.submitList(listData, true)
|
|
|
- binding.tvCount.text= item.frameList?.size.toString()
|
|
|
+ binding.tvCount.text = item.frameList?.size.toString()
|
|
|
+ binding.tvCount.show(isShow = isSelf)
|
|
|
|
|
|
- if (item.uid==ProfileModule.getMyUid()){
|
|
|
+ if (item.uid == ProfileModule.getMyUid()) {
|
|
|
binding.root.setOnClickListener {
|
|
|
Router.build(it.context, Backpack.Backpack.PATH)
|
|
|
.putExtra(Backpack.Common.EXTRA_TYPE, BACKPACK_TAB_INDEX_FRAMES)
|