[mobile] update oval style

pull/137/head
FongMi 2 years ago
parent 0cf5e8c7e0
commit 5e6db62b65
  1. 7
      app/src/mobile/java/com/fongmi/android/tv/ui/holder/VodOvalHolder.java
  2. 30
      app/src/mobile/res/layout/adapter_vod_oval.xml

@ -20,15 +20,16 @@ public class VodOvalHolder extends BaseVodHolder {
}
public VodOvalHolder size(int[] size) {
this.itemView.getLayoutParams().width = size[0];
this.itemView.getLayoutParams().height = size[1];
this.binding.image.getLayoutParams().width = size[0];
this.binding.image.getLayoutParams().height = size[1];
return this;
}
@Override
public void initView(Vod item) {
ImgUtil.load(item.getVodPic(), binding.image);
binding.name.setText(item.getVodName());
binding.getRoot().setOnClickListener(v -> listener.onItemClick(item));
binding.getRoot().setOnLongClickListener(v -> listener.onLongClick(item));
ImgUtil.load(item.getVodPic(), binding.image);
}
}

@ -2,18 +2,36 @@
<RelativeLayout 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="150dp"
android:layout_height="150dp"
android:layout_margin="8dp"
android:foreground="@drawable/shape_vod_circle">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black_20"
android:foreground="@drawable/shape_vod_circle"
android:scaleType="center"
app:shapeAppearanceOverlay="@style/Vod.Circle"
tools:src="@drawable/ic_img_loading" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/image"
android:layout_alignStart="@+id/image"
android:layout_alignEnd="@+id/image"
android:layout_marginTop="8dp"
android:gravity="center"
android:shadowColor="@color/grey_900"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="蜘蛛人" />
</RelativeLayout>
Loading…
Cancel
Save