1.礼物列表UI调整
This commit is contained in:
@@ -130,34 +130,6 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
val emptyView = LayoutInflater.from(context)
|
||||
.inflate(R.layout.item_userinfo_gift_empty, null, false)
|
||||
giftAdapter?.emptyView = emptyView
|
||||
binding.rvGift.addItemDecoration(object : ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
outRect.bottom = UIUtil.dip2px(context, 12.0)
|
||||
val position = parent.getChildAdapterPosition(view)
|
||||
val space = UIUtil.dip2px(context, 40.0)
|
||||
val margin = UIUtil.dip2px(context, 15.0)
|
||||
when (position) {
|
||||
0 -> {
|
||||
outRect.left = margin
|
||||
outRect.right = space / 2
|
||||
}
|
||||
1, 2 -> {
|
||||
outRect.left = space / 2
|
||||
outRect.right = space / 2
|
||||
}
|
||||
3 -> {
|
||||
outRect.left = space / 2
|
||||
outRect.right = margin
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
giftAdapter?.setEnableLoadMore(false)
|
||||
giftAdapter?.bindToRecyclerView(binding.rvGift)
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#ffefebff" />
|
||||
<solid android:color="#FFF0C9" />
|
||||
<corners
|
||||
android:bottomLeftRadius="8dp"
|
||||
android:bottomRightRadius="8dp"
|
||||
android:topLeftRadius="8dp"
|
||||
android:topRightRadius="4dp" />
|
||||
android:bottomLeftRadius="6dp"
|
||||
android:bottomRightRadius="2dp"
|
||||
android:topLeftRadius="2dp"
|
||||
android:topRightRadius="6dp" />
|
||||
</shape>
|
||||
|
||||
@@ -313,12 +313,10 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="2dp"
|
||||
|
||||
@@ -2,34 +2,32 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/app_logo"
|
||||
/>
|
||||
android:src="@mipmap/app_logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_user_gift_item"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
tools:text="x20"
|
||||
android:textColor="@color/app_248cfe"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="-5dp"
|
||||
android:background="@drawable/bg_user_gift_item"
|
||||
/>
|
||||
tools:text="x20" />
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user