layout_item_short_video.xml 3.02 KB
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

        <import type="com.cnlive.gundam.shortvideo.model.ShortVideoInfo" />

        <import type="android.view.View" />

        <import type="com.cnlive.gundam.main.ui.adapter.DataBindingAdapter.OnAdapterViewClickListener" />

        <variable
            name="shortVideoInfo"
            type="ShortVideoInfo" />

        <variable
            name="viewClickListner"
            type="OnAdapterViewClickListener&lt;ShortVideoInfo>" />
    </data>

    <LinearLayout
        android:id="@+id/item_short_video"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"

        android:onClick="@{(view)->viewClickListner.onViewClick(view, shortVideoInfo)}"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/cover_image"
                android:layout_width="90dp"
                android:layout_height="90dp"
                android:padding="2dp"
                app:error="@{@drawable/default_pic}"
                app:imageUrl="@{shortVideoInfo.picKey}" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="90dp"
                android:layout_marginLeft="10dp"
                android:gravity="center_vertical"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/video_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@{shortVideoInfo.name}"
                    android:textColor="@color/black"
                    android:textSize="18sp" />

                <!--<TextView-->
                <!--android:id="@+id/video_time"-->
                <!--android:layout_width="wrap_content"-->
                <!--android:layout_height="wrap_content"-->
                <!--android:layout_marginLeft="10dp"-->
                <!--android:layout_marginTop="10dp"-->
                <!--android:text="@{shortVideoInfo.createTime}"-->
                <!--android:textSize="14sp" />-->

                <TextView
                    android:id="@+id/video_description"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="3dp"
                    android:text="@{shortVideoInfo.description}"
                    android:textSize="14sp" />

            </LinearLayout>

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/gray_line_color" />

    </LinearLayout>
</layout>