直播app開發搭建,實現圖片和影片列表展示、檢視、刪除等功能

zhibo系統開發發表於2023-05-12

直播app開發搭建,實現圖片和影片列表展示、檢視、刪除等功能

佈局media_item_title.xml(效果圖中日期的佈局)

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns: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="
    xmlns:app="
    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="
    xmlns:app="
    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開發搭建,實現圖片和影片列表展示、檢視、刪除等功能,更多內容歡迎關注之後的文章


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69978258/viewspace-2951719/,如需轉載,請註明出處,否則將追究法律責任。

相關文章