调整游戏详情横向滑动列表边距
This commit is contained in:
@ -85,6 +85,7 @@ class GameGalleryAdapter(var context: Context,
|
||||
}
|
||||
val params = holder.itemView.layoutParams as RecyclerView.LayoutParams
|
||||
params.leftMargin = DisplayUtils.dip2px(if (position == 0) 20f else 8f)
|
||||
params.rightMargin = DisplayUtils.dip2px(if (position == itemCount - 1) 20f else 0f)
|
||||
holder.itemView.layoutParams = params
|
||||
}
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ class GameRaidersAdapter(val context: Context, val articles: ArrayList<NewsEntit
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
val params = holder.itemView.layoutParams as RecyclerView.LayoutParams
|
||||
params.leftMargin = DisplayUtils.dip2px(if (position == 0) 20f else 12f)
|
||||
params.rightMargin = DisplayUtils.dip2px(if (position == itemCount - 1) 20f else 0f)
|
||||
holder.itemView.layoutParams = params
|
||||
val newsEntity = articles[position]
|
||||
if (holder is RaidersViewHolder) {
|
||||
|
||||
Reference in New Issue
Block a user