<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"

    android:layout_height="wrap_content"
    android:layout_marginBottom="6dp"
    app:cardCornerRadius="10dp"
    app:cardElevation="0dp">

    <!-- 改用ConstraintLayout包裹，精准控制图片宽高比（宽:高=10:7，高度缩短） -->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/preview"
            android:layout_width="match_parent"
            android:layout_height="0dp"
        android:scaleType="centerCrop"

        app:layout_constraintDimensionRatio="10:9"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"/>

        <com.example.wallisyn.tool.MyText
            android:id="@+id/tv_class_name"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:background="@color/color_main_view"
            android:gravity="center"
            android:text="@string/app_name"
            android:textColor="@color/white"
            android:textSize="16sp"
            app:apply_font="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

<View
android:id="@+id/space_view"
android:layout_width="match_parent"
android:layout_height="6dp"
android:visibility="gone" />
    </LinearLayout>