抖音布局(约束布局)
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"> <com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer android:id="@+id/gsy" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent"></com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer> <!-- 最右边--> <ImageView android:id="@+id/iv_zhuan_tj" android:layout_width="@dimen/dp_40" android:layout_height="@dimen/dp_40" android:layout_marginRight="@dimen/dp_20" android:layout_marginBottom="@dimen/dp_20" android:background="@drawable/shape_tuijian_tou" android:src="@mipmap/ic_launcher" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toRightOf="parent"></ImageView> <TextView android:id="@+id/tv_fenxinag" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dp_20" android:text="1.2万" android:textColor="@color/white" app:layout_constraintBottom_toTopOf="@id/iv_zhuan_tj" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></TextView> <ImageView android:id="@+id/iv_fengxiang" android:layout_width="@dimen/dp_30" android:layout_height="@dimen/dp_30" android:layout_marginBottom="@dimen/dp_15" android:src="@drawable/baseline_share_24" app:layout_constraintBottom_toTopOf="@id/tv_fenxinag" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></ImageView> <TextView android:id="@+id/tv_shoucang" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dp_60" android:text="1.8万" android:textColor="@color/white" app:layout_constraintBottom_toTopOf="@id/tv_fenxinag" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></TextView> <ImageView android:id="@+id/iv_shoucang" android:layout_width="@dimen/dp_30" android:layout_height="@dimen/dp_30" android:layout_marginBottom="@dimen/dp_15" android:src="@drawable/baseline_star_outline_24" app:layout_constraintBottom_toTopOf="@id/tv_shoucang" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></ImageView> <TextView android:id="@+id/tv_pinglun" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dp_60" android:text="2.0万" android:textColor="@color/white" app:layout_constraintBottom_toTopOf="@id/tv_shoucang" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></TextView> <ImageView android:id="@+id/iv_pinglun" android:layout_width="@dimen/dp_30" android:layout_height="@dimen/dp_30" android:layout_marginBottom="@dimen/dp_15" android:src="@drawable/baseline_textsms_24" app:layout_constraintBottom_toTopOf="@id/tv_pinglun" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></ImageView> <TextView android:id="@+id/tv_dizan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dp_20" android:text="15.2万" android:textColor="@color/white" app:layout_constraintBottom_toTopOf="@id/iv_pinglun" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></TextView> <ImageView android:id="@+id/iv_tou" android:layout_width="@dimen/dp_30" android:layout_height="@dimen/dp_30" android:layout_marginBottom="@dimen/dp_15" android:src="@drawable/baseline_favorite_24" app:layout_constraintBottom_toTopOf="@id/tv_dizan" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></ImageView> <ImageView android:id="@+id/iv_add" android:layout_width="@dimen/dp_40" android:layout_height="@dimen/dp_40" android:layout_marginBottom="@dimen/dp_20" android:background="@drawable/shape_tuijian_tou" android:src="@mipmap/ic_launcher" app:layout_constraintBottom_toTopOf="@id/iv_tou" app:layout_constraintLeft_toLeftOf="@id/iv_zhuan_tj" app:layout_constraintRight_toRightOf="@id/iv_zhuan_tj"></ImageView> <!-- 左下方--> <TextView android:id="@+id/tv_pao" android:layout_width="@dimen/dp_160" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/dp_6" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:singleLine="true" android:text="常青书的操作" android:textColor="@color/white" android:textSize="@dimen/sp_20" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent"></TextView> <TextView android:id="@+id/tv_caption" android:layout_width="@dimen/dp_170" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_6" android:text="吃不了学习的苦,就吃生活的苦" android:textColor="@color/white" android:textSize="@dimen/sp_20" app:layout_constraintBottom_toTopOf="@id/tv_pao" app:layout_constraintLeft_toLeftOf="parent"></TextView> <TextView android:id="@+id/tv_user" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="常青树" android:textColor="@color/white" android:textSize="@dimen/sp_20" app:layout_constraintBottom_toTopOf="@id/tv_caption" app:layout_constraintLeft_toLeftOf="parent"></TextView> <!-- 定位--> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="@dimen/dp_200" app:layout_constraintBottom_toTopOf="@id/tv_user" app:layout_constraintLeft_toLeftOf="@id/tv_pao" android:background="@drawable/shape_dingwei" android:layout_height="wrap_content"> <ImageView android:id="@+id/iv_dingwei" android:layout_width="@dimen/dp_30" android:layout_height="@dimen/dp_30" app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintBottom_toBottomOf="parent" android:src="@drawable/baseline_add_location_24"></ImageView> <TextView android:textSize="@dimen/dp_20" android:text="天津八维培训学校" android:id="@+id/tv_dingwei" android:textColor="@color/white" android:layout_marginLeft="@dimen/dp_6" app:layout_constraintLeft_toRightOf="@id/iv_dingwei" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </androidx.constraintlayout.widget.ConstraintLayout> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="@dimen/dp_200" android:layout_height="wrap_content" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" android:background="@drawable/shape_heping" android:layout_marginTop="@dimen/dp_200"> <ImageView android:src="@drawable/ic_hengping" android:layout_width="@dimen/dp_30" android:layout_height="@dimen/dp_30" android:id="@+id/iv_quan" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent"></ImageView> <TextView android:text="全屏播放" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toRightOf="@id/iv_quan" android:layout_marginLeft="@dimen/dp_10" android:textColor="@color/white"></TextView> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
Glide加载图片