combine play icon and duration of video thumbnails

This commit is contained in:
gmasil 2023-12-19 15:29:19 +01:00
parent 7d218d780e
commit bfcf018570
No known key found for this signature in database
GPG key ID: 135FC0B941F3ECC7
4 changed files with 41 additions and 30 deletions

View file

@ -619,7 +619,7 @@ class MediaAdapter(
playPortraitOutline?.beVisibleIf(medium.isVideo() || medium.isPortrait()) playPortraitOutline?.beVisibleIf(medium.isVideo() || medium.isPortrait())
if (medium.isVideo()) { if (medium.isVideo()) {
playPortraitOutline?.setImageResource(org.fossify.commons.R.drawable.ic_play_outline_vector) playPortraitOutline?.setImageResource(org.fossify.commons.R.drawable.ic_play_vector)
playPortraitOutline?.beVisible() playPortraitOutline?.beVisible()
} else if (medium.isPortrait()) { } else if (medium.isPortrait()) {
playPortraitOutline?.setImageResource(R.drawable.ic_portrait_photo_vector) playPortraitOutline?.setImageResource(R.drawable.ic_portrait_photo_vector)

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="@dimen/rounded_corner_radius_small"/> <corners android:radius="200000dp"/>
<solid android:color="@color/hint_black"/> <solid android:color="@color/hint_black"/>
</shape> </shape>

View file

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFF" android:pathData="M16.247 11.424l-5.61-4.079c-0.206-0.149-0.48-0.171-0.705-0.055-0.228 0.115-0.37 0.348-0.37 0.601v8.154c0 0.255 0.142 0.488 0.37 0.603 0.096 0.049 0.201 0.073 0.307 0.073 0.139 0 0.279-0.044 0.398-0.131l5.61-4.075c0.177-0.13 0.28-0.332 0.28-0.546 0.001-0.217-0.105-0.418-0.28-0.545z"/>
</vector>

View file

@ -12,16 +12,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<ImageView
android:id="@+id/play_portrait_outline"
android:layout_width="@dimen/selection_check_size"
android:layout_height="@dimen/selection_check_size"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_margin="@dimen/small_margin"
android:src="@drawable/ic_play_outline_vector"
android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/favorite" android:id="@+id/favorite"
android:layout_width="@dimen/selection_check_size" android:layout_width="@dimen/selection_check_size"
@ -35,26 +25,44 @@
android:src="@drawable/ic_star_vector" android:src="@drawable/ic_star_vector"
android:visibility="gone" /> android:visibility="gone" />
<TextView <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/video_duration" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/play_icon_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/play_portrait_outline" android:layout_marginTop="@dimen/small_margin"
android:layout_alignBottom="@+id/play_portrait_outline" android:layout_marginLeft="@dimen/small_margin"
android:layout_marginTop="@dimen/tiny_margin" android:background="@drawable/darkened_automatic_circle_background" >
android:layout_toEndOf="@id/play_portrait_outline"
android:ellipsize="end" <ImageView
android:gravity="end" android:id="@+id/play_portrait_outline"
android:maxLines="1" android:layout_width="@dimen/selection_check_size"
android:shadowColor="@color/md_grey_black_dark" android:layout_height="@dimen/selection_check_size"
android:shadowRadius="6" android:layout_alignParentStart="true"
android:textColor="@android:color/white" android:layout_alignParentTop="true"
android:textSize="@dimen/normal_text_size" android:layout_margin="0dp"
android:visibility="gone" android:visibility="gone" />
android:background="@drawable/darkened_rounded_background"
android:paddingTop="@dimen/one_dp" <TextView
android:paddingHorizontal="@dimen/small_margin" android:id="@+id/video_duration"
tools:text="02:34" /> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/play_portrait_outline"
android:layout_alignBottom="@+id/play_portrait_outline"
android:layout_marginTop="@dimen/tiny_margin"
android:layout_marginRight="10dp"
android:layout_toEndOf="@id/play_portrait_outline"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:shadowColor="@color/md_grey_black_dark"
android:shadowRadius="6"
android:textColor="@android:color/white"
android:textSize="@dimen/normal_text_size"
android:visibility="gone"
tools:text="02:34" />
</RelativeLayout>
<ImageView <ImageView
android:id="@+id/medium_check" android:id="@+id/medium_check"