优化直播间心愿显示文字和图片重叠的问题---改为跑马灯

This commit is contained in:
老皮 2024-10-15 16:42:34 +08:00
parent fb340a152b
commit 151abf13e8
2 changed files with 22 additions and 6 deletions

View File

@ -36,6 +36,7 @@ public class TopBannerCustomViewHolder implements BannerViewHolder<BannerBean> {
view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_wish, null); view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_wish, null);
ImageView wishlistIcon = view.findViewById(R.id.wishlist_icon); ImageView wishlistIcon = view.findViewById(R.id.wishlist_icon);
TextView wishlistName = view.findViewById(R.id.wishlist_name); TextView wishlistName = view.findViewById(R.id.wishlist_name);
wishlistName.setSelected(true);
TextView wishlistProgress = view.findViewById(R.id.wishlist_progress); TextView wishlistProgress = view.findViewById(R.id.wishlist_progress);
ImgLoader.display(context, data.getWishlistIcon(), wishlistIcon); ImgLoader.display(context, data.getWishlistIcon(), wishlistIcon);
wishlistName.setText(data.getWishlistName()); wishlistName.setText(data.getWishlistName());

View File

@ -2,22 +2,32 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="52dp" android:layout_width="52dp"
android:layout_height="54dp" android:layout_height="wrap_content"
android:paddingBottom="2dp"
android:background="@mipmap/bg_xyd"> android:background="@mipmap/bg_xyd">
<ImageView <ImageView
android:id="@+id/wishlist_icon" android:id="@+id/wishlist_icon"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp"
android:layout_gravity="center" /> android:layout_gravity="center"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="2dp"
/>
<TextView <TextView
android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:text="@string/live_use_wish" android:text="@string/live_use_wish"
@ -28,12 +38,17 @@
android:id="@+id/wishlist_name" android:id="@+id/wishlist_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="3dp"
android:text="sjhasdjkjk" android:text="sjhasdjkjk"
android:textColor="@color/white" android:textColor="@color/white"
app:layout_constraintTop_toBottomOf="@id/wishlist_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:ellipsize="marquee"
android:maxLines="1"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:textSize="8sp" /> android:textSize="8sp" />
</FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<TextView <TextView
android:id="@+id/wishlist_progress" android:id="@+id/wishlist_progress"