From 49c678949b11e8943efb3012c80221fcdfcee105 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 19 Jun 2025 11:09:41 +0800 Subject: [PATCH] =?UTF-8?q?[8.1.0]=20[fix]=20[=E7=AB=99=E7=82=B94=E4=B8=AA?= =?UTF-8?q?=E9=AB=98=E5=BA=A6100]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passenger/ui/line/lineinfo/item/ItemDecoration.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OCH/shuttle/passenger_weaknet/src/main/java/b2/com/mogo/och/shuttle/weaknet/passenger/ui/line/lineinfo/item/ItemDecoration.kt b/OCH/shuttle/passenger_weaknet/src/main/java/b2/com/mogo/och/shuttle/weaknet/passenger/ui/line/lineinfo/item/ItemDecoration.kt index e25580bec3..e33191337a 100644 --- a/OCH/shuttle/passenger_weaknet/src/main/java/b2/com/mogo/och/shuttle/weaknet/passenger/ui/line/lineinfo/item/ItemDecoration.kt +++ b/OCH/shuttle/passenger_weaknet/src/main/java/b2/com/mogo/och/shuttle/weaknet/passenger/ui/line/lineinfo/item/ItemDecoration.kt @@ -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