Support audio attachments through GalleryMediaChooser

GalleryMediaChooser supports audio types also. It displays simple audio
icon and file info for audio files on grid views.

Test: Manual

Change-Id: I98b605156af3c1909c0141a2b99380b5da11c1e2
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
Taesu Lee
2020-02-20 08:52:44 +09:00
parent 6c77158718
commit 2716c26c23
9 changed files with 188 additions and 71 deletions
+56 -10
View File
@@ -21,12 +21,67 @@
android:background="@color/gallery_image_default_background"
android:clickable="true">
<!-- Thumbnail for image and video contents. -->
<com.android.messaging.ui.AsyncImageView
android:id="@+id/image"
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<!-- Additional info such as icon, name and etc. -->
<RelativeLayout
android:id="@+id/additional_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical"
android:visibility="gone" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/file_info" >
<ImageView
android:id="@+id/icon"
android:layout_width="@dimen/gallery_icon_size"
android:layout_height="@dimen/gallery_icon_size"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:background="@color/background_item_transparent"
android:visibility="gone" />
</FrameLayout>
<!-- File info for audio contents only -->
<LinearLayout
android:id="@+id/file_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="4dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:orientation="vertical"
android:visibility="gone" >
<TextView
android:id="@+id/file_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="@android:style/TextAppearance.Material.Subhead" />
<TextView
android:id="@+id/file_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:gravity="right"
android:textAppearance="@android:style/TextAppearance.Material.Caption" />
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -44,13 +99,4 @@
android:visibility="gone"
android:contentDescription="@string/gallery_checkbox_content_description" />
<!-- Play button image for video contents only -->
<ImageView
android:id="@+id/video_thumbnail_play_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/background_item_transparent"
android:src="@drawable/ic_video_play_light"
android:visibility="gone" />
</com.android.messaging.ui.mediapicker.GalleryGridItemView>
+1
View File
@@ -85,6 +85,7 @@
<!-- Flings faster than this length / sec will go from fullscreen straight to closed -->
<dimen name="mediapicker_big_fling_threshold">1000dp</dimen>
<dimen name="gallery_image_cell_size">110dp</dimen>
<dimen name="gallery_icon_size">40dp</dimen>
<dimen name="single_attachment_min_dimen">50dp</dimen>
<dimen name="single_attachment_max_height">150dp</dimen>
<dimen name="multiple_attachment_preview_height">130dp</dimen>