直播app开发搭建,实现图片和视频列表展示、查看、删除等功能
直播app开发搭建,实现图片和视频列表展示、查看、删除等功能
布局media_item_title.xml(效果图中日期的布局)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="40dp">
<TextView
android:id="@+id/txtTitle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp"
android:text="TextView"
android:textColor="@color/colorFontCommon"
android:textSize="20sp" />
</RelativeLayout>
布局media_item_photo.xml(效果图中图片的布局),布局中添加了复选框,用来做删除功能时使用。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imgPhoto"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_marginStart="1dp"
android:layout_marginLeft="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="1dp"
app:srcCompat="@drawable/app_deploy" />
<CheckBox
android:id="@+id/chkSelect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:visibility="invisible" />
</RelativeLayout>
布局media_item_video.xml(视频的布局)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">
<ImageView
android:id="@+id/imgVideo"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_marginStart="1dp"
android:layout_marginLeft="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="1dp"
app:srcCompat="@drawable/app_deploy" />
<ImageButton
android:id="@+id/btnPlay"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/btn_play" />
<CheckBox
android:id="@+id/chkSelect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:visibility="invisible" />
</RelativeLayout>
以上就是 直播app开发搭建,实现图片和视频列表展示、查看、删除等功能,更多内容欢迎关注之后的文章
浙公网安备 33010602011771号