视频合集、浏览记录、我的收藏视频点击用户头像昵称跳转个人主页
This commit is contained in:
@ -15,7 +15,7 @@ import com.gh.gamecenter.video.VideoItemViewHolder
|
||||
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel
|
||||
|
||||
class VideoAdapter(context: Context,
|
||||
val mViewModel: VideoViewModel, val mVideoStyle: String) : ListAdapter<MyVideoEntity>(context) {
|
||||
val mViewModel: VideoViewModel, val mVideoStyle: String, val mEntrance: String) : ListAdapter<MyVideoEntity>(context) {
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
if (position == itemCount - 1) return ItemViewType.ITEM_FOOTER
|
||||
return ItemViewType.ITEM_BODY
|
||||
@ -63,6 +63,10 @@ class VideoAdapter(context: Context,
|
||||
})
|
||||
}
|
||||
}
|
||||
holder.binding.userIcon.setOnClickListener {
|
||||
DirectUtils.directToHomeActivity(mContext, entity.user.id, mEntrance, getPath())
|
||||
}
|
||||
holder.binding.userName.setOnClickListener { holder.binding.userIcon.performClick() }
|
||||
} else if (holder is FooterViewHolder) {
|
||||
holder.initFooterViewHolder(mViewModel, mIsLoading, mIsNetworkError, mIsOver)
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ class VideoFragment : ListFragment<MyVideoEntity, VideoViewModel>() {
|
||||
|
||||
override fun provideListAdapter(): VideoAdapter {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = VideoAdapter(requireContext(), mViewModel!!, mVideoStyle)
|
||||
mAdapter = VideoAdapter(requireContext(), mViewModel!!, mVideoStyle,mEntrance)
|
||||
}
|
||||
return mAdapter!!
|
||||
}
|
||||
|
||||
@ -64,6 +64,11 @@ class GameVideoAdapter(context: Context,
|
||||
path = "视频合集-最新"
|
||||
}
|
||||
DirectUtils.directToVideoDetail(mContext, entity.id, fromLocation, false, gameId = gameId, entrance = mEntrance, path = path)
|
||||
|
||||
holder.binding.userIcon.setOnClickListener {
|
||||
DirectUtils.directToHomeActivity(mContext, entity.user.id, mEntrance, path)
|
||||
}
|
||||
holder.binding.userName.setOnClickListener { holder.binding.userIcon.performClick() }
|
||||
}
|
||||
} else if (holder is FooterViewHolder) {
|
||||
holder.initFooterViewHolder(mViewModel, mIsLoading, mIsNetworkError, mIsOver)
|
||||
|
||||
Reference in New Issue
Block a user