新增 首页房间item PK动画
This commit is contained in:
BIN
app/src/main/assets/svga/svga_home_pk.svga
Normal file
BIN
app/src/main/assets/svga/svga_home_pk.svga
Normal file
Binary file not shown.
@@ -40,8 +40,6 @@ class HomeHotAdapter :
|
||||
icTopList.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
val svgaLiving = helper.getView<SVGAImageView>(R.id.svga_living)
|
||||
|
||||
val avatars: Array<ImageView> = arrayOf(
|
||||
helper.getView(R.id.iv_avatar_0),
|
||||
helper.getView(R.id.iv_avatar_1),
|
||||
@@ -55,6 +53,15 @@ class HomeHotAdapter :
|
||||
avatars[i].load(avatarUrl)
|
||||
}
|
||||
|
||||
val svgaPk = helper.getView<SVGAImageView>(R.id.svga_pk)
|
||||
if (item.isCrossPking) {
|
||||
svgaPk.visibility = View.VISIBLE
|
||||
svgaPk.loadFromAssets("svga/svga_home_pk.svga")
|
||||
} else {
|
||||
svgaPk.visibility = View.GONE
|
||||
}
|
||||
|
||||
val svgaLiving = helper.getView<SVGAImageView>(R.id.svga_living)
|
||||
svgaLiving.loadFromAssets("svga/home_white_living.svga")
|
||||
}
|
||||
|
||||
|
@@ -4,9 +4,9 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_6"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_6"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
android:id="@+id/iv_room_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/default_cover"
|
||||
android:layout_margin="@dimen/dp_2"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_top_list"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_top_list"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_top_list"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="@dimen/dp_14"
|
||||
app:layout_constraintDimensionRatio="170:174"
|
||||
app:type="round"
|
||||
app:borderRadius="@dimen/dp_14"/>
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_top_list"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_top_list"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_top_list"
|
||||
app:type="round" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_top_list"
|
||||
@@ -29,11 +29,11 @@
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:background="@drawable/bg_recommend_weekly_list"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintDimensionRatio="174:178"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_tag"
|
||||
@@ -103,16 +103,16 @@
|
||||
android:id="@+id/tv_room_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_room_image"
|
||||
app:layout_constraintEnd_toStartOf="@+id/svga_living"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_room_image"
|
||||
app:layout_constraintEnd_toStartOf="@+id/svga_living"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_room_image"
|
||||
tools:text="@string/layout_item_room_common_02" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
@@ -120,9 +120,17 @@
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_online_number"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_online_number"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_online_number"/>
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_online_number"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_online_number" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/svga_pk"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/fl_avatar"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_online_number"
|
||||
app:layout_constraintTop_toTopOf="@+id/fl_avatar" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_online_number"
|
||||
@@ -133,9 +141,9 @@
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_room_title"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_room_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_room_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_room_title"
|
||||
tools:text="266" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Reference in New Issue
Block a user