房间相册 UI问题
This commit is contained in:
@@ -73,7 +73,6 @@ class RoomAlbumActivity : BaseViewBindingActivity<ActivityRoomAlbumBinding>() {
|
||||
lineHeight = resources.getDimensionPixelOffset(R.dimen.dp_4).toFloat()
|
||||
lineWidth = resources.getDimensionPixelOffset(R.dimen.dp_15).toFloat()
|
||||
roundRadius = resources.getDimensionPixelOffset(R.dimen.dp_2).toFloat()
|
||||
//yOffset = resources.getDimensionPixelOffset(R.dimen.dp_4).toFloat()
|
||||
mode = LinePagerIndicator.MODE_EXACTLY
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.yizhuan.erban.avroom.room_album
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.fragment.app.activityViewModels
|
||||
@@ -35,12 +36,13 @@ class RoomAlbumFragment : BaseViewBindingFragment<FragmentRoomAlbumBinding>() {
|
||||
|
||||
override fun init() {
|
||||
binding.recyclerView.layoutManager = GridLayoutManager(context, 2)
|
||||
val offset = resources.getDimensionPixelOffset(R.dimen.dp_15)
|
||||
val offsetH = resources.getDimensionPixelOffset(R.dimen.dp_7)
|
||||
val offsetV = resources.getDimensionPixelOffset(R.dimen.dp_4)
|
||||
binding.recyclerView.addItemDecoration(
|
||||
GridSpacingItemNewDecoration(
|
||||
offset,
|
||||
offset,
|
||||
true
|
||||
offsetV,
|
||||
offsetH,
|
||||
false
|
||||
)
|
||||
)
|
||||
val adapter = object :
|
||||
@@ -96,6 +98,9 @@ class RoomAlbumFragment : BaseViewBindingFragment<FragmentRoomAlbumBinding>() {
|
||||
}
|
||||
|
||||
}.apply {
|
||||
addFooterView(View(context).apply {
|
||||
layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, resources.getDimensionPixelOffset(R.dimen.dp_80))
|
||||
})
|
||||
setEnableLoadMore(true)
|
||||
setOnLoadMoreListener({
|
||||
viewModel.loadPhotos(type, ++page)
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 8.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners android:radius="@dimen/dp_20" />
|
||||
<corners android:radius="@dimen/dp_24" />
|
||||
|
||||
<gradient
|
||||
android:endColor="@color/color_CF70FF"
|
7
app/src/main/res/drawable/bg_gift_icon.xml
Normal file
7
app/src/main/res/drawable/bg_gift_icon.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
|
||||
<solid android:color="@color/color_001338" />
|
||||
|
||||
</shape>
|
12
app/src/main/res/drawable/bg_gift_icon_stroke.xml
Normal file
12
app/src/main/res/drawable/bg_gift_icon_stroke.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
|
||||
<solid android:color="@color/color_001338" />
|
||||
|
||||
<stroke
|
||||
android:width="@dimen/dp_1"
|
||||
android:color="@color/color_D6D6D6" />
|
||||
|
||||
</shape>
|
@@ -22,16 +22,23 @@
|
||||
android:id="@+id/vp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/indicator" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:src="@drawable/img_mask_room_album_list_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_upload"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_94"
|
||||
android:layout_marginStart="@dimen/dp_36"
|
||||
android:layout_marginEnd="@dimen/dp_36"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:background="@drawable/bg_activity_room_album_upload"
|
||||
android:gravity="center"
|
||||
android:text="@string/upload_picture"
|
||||
|
@@ -13,6 +13,7 @@
|
||||
android:text="贈送禮物解鎖照片"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -31,6 +32,7 @@
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:background="@drawable/bg_gift_icon"
|
||||
android:src="@drawable/default_cover"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -78,7 +80,7 @@
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:background="@drawable/bg_5aecfa_cf70ff_20"
|
||||
android:background="@drawable/bg_5aecfa_cf70ff_24"
|
||||
android:gravity="center"
|
||||
android:text="馬上解鎖"
|
||||
android:textColor="@color/white"
|
||||
|
@@ -42,6 +42,7 @@
|
||||
android:text="@string/photo_type"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_type"
|
||||
app:layout_constraintStart_toStartOf="@id/v_type"
|
||||
app:layout_constraintTop_toTopOf="@id/v_type" />
|
||||
@@ -99,6 +100,7 @@
|
||||
android:text="@string/unlock_gift"
|
||||
android:textColor="@color/color_B3B3C3"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintStart_toStartOf="@id/v_gift"
|
||||
app:layout_constraintTop_toTopOf="@id/v_gift" />
|
||||
@@ -131,6 +133,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_diamond"
|
||||
@@ -153,6 +156,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:text="@string/zero"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_gift_more"
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout 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:id="@+id/refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -11,8 +12,12 @@
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fadingEdge="vertical"
|
||||
android:fadingEdgeLength="@dimen/dp_60"
|
||||
android:requiresFadingEdge="vertical" />
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:itemCount="20"
|
||||
tools:listitem="@layout/item_room_album" />
|
||||
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
@@ -3,12 +3,12 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_170"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_4"
|
||||
app:cornerRadius="@dimen/dp_8"
|
||||
app:shadowRadius="@dimen/dp_4"
|
||||
tools:layout_gravity="center"
|
||||
tools:layout_width="@dimen/dp_170">
|
||||
tools:layout_width="@dimen/dp_168">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -17,9 +17,11 @@
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_cover"
|
||||
app:layout_constraintDimensionRatio="168:170"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="@dimen/dp_8" />
|
||||
|
||||
<ImageView
|
||||
@@ -45,13 +47,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:background="@drawable/bg_mask_room_album"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_pic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:background="@drawable/bg_gift_icon_stroke"
|
||||
android:src="@drawable/default_cover"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_bottom_mask"
|
||||
app:layout_constraintStart_toStartOf="@id/v_bottom_mask"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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="@dimen/dp_162"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_room_message_bg"
|
||||
android:padding="@dimen/dp_12">
|
||||
@@ -68,6 +68,7 @@
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:background="@drawable/bg_gift_icon_stroke"
|
||||
android:src="@drawable/default_cover"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_bottom_mask"
|
||||
app:layout_constraintStart_toStartOf="@id/v_bottom_mask"
|
||||
@@ -75,8 +76,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_diamond"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:src="@mipmap/ic_charge_diamond"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_bottom_mask"
|
||||
@@ -97,9 +98,12 @@
|
||||
<TextView
|
||||
android:id="@+id/tv_unlock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:background="@drawable/bg_9168fa_6"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_11"
|
||||
android:paddingTop="@dimen/dp_3"
|
||||
android:paddingEnd="@dimen/dp_11"
|
||||
|
@@ -702,5 +702,6 @@
|
||||
<color name="color_306065">#306065</color>
|
||||
<color name="color_1E686868">#1E686868</color>
|
||||
<color name="color_9E9EA8">#9E9EA8</color>
|
||||
<color name="color_001338">#001338</color>
|
||||
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user