[8.1.0]
[fix] [站点4个高度100]
This commit is contained in:
@@ -15,8 +15,14 @@ class ItemDecoration() : RecyclerView.ItemDecoration() {
|
||||
outRect: Rect, view: View,
|
||||
parent: RecyclerView, state: RecyclerView.State
|
||||
) {
|
||||
if((parent.adapter?.itemCount ?: 4) < 4){
|
||||
val height = AutoSizeUtils.dp2px(parent.context,140f)
|
||||
if((parent.adapter?.itemCount ?: 4) < 4) {
|
||||
val height = AutoSizeUtils.dp2px(parent.context, 140f)
|
||||
|
||||
val layoutParams = view.layoutParams as RecyclerView.LayoutParams
|
||||
layoutParams.height = height
|
||||
view.layoutParams = layoutParams
|
||||
}else if((parent.adapter?.itemCount ?: 4) == 4){
|
||||
val height = AutoSizeUtils.dp2px(parent.context, 100f)
|
||||
|
||||
val layoutParams = view.layoutParams as RecyclerView.LayoutParams
|
||||
layoutParams.height = height
|
||||
|
||||
Reference in New Issue
Block a user