Added stars to mark favorite items (#2102)

This commit is contained in:
Agnieszka C 2021-11-07 19:42:08 +01:00
parent e849c6f7c0
commit af3b44d470
5 changed files with 52 additions and 1 deletions

View file

@ -35,6 +35,7 @@ import kotlinx.android.synthetic.main.photo_item_grid.view.*
import kotlinx.android.synthetic.main.thumbnail_section.view.*
import kotlinx.android.synthetic.main.video_item_grid.view.*
import kotlinx.android.synthetic.main.video_item_grid.view.media_item_holder
import kotlinx.android.synthetic.main.video_item_grid.view.favorite
import kotlinx.android.synthetic.main.video_item_grid.view.medium_check
import kotlinx.android.synthetic.main.video_item_grid.view.medium_name
import kotlinx.android.synthetic.main.video_item_grid.view.medium_thumbnail
@ -524,6 +525,8 @@ class MediaAdapter(
media_item_holder.setPadding(padding, padding, padding, padding)
favorite.beVisibleIf(medium.isFavorite)
play_portrait_outline?.beVisibleIf(medium.isVideo() || medium.isPortrait())
if (medium.isVideo()) {
play_portrait_outline?.setImageResource(R.drawable.ic_play_outline_vector)

View file

@ -27,6 +27,18 @@
android:textSize="@dimen/bigger_text_size"
android:visibility="gone" />
<ImageView
android:id="@+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/small_margin"
android:gravity="end"
android:background="@drawable/circle_black_background"
android:src="@drawable/ic_star_on_vector"
android:visibility="gone" />
<ImageView
android:id="@+id/medium_check"
android:layout_width="@dimen/selection_check_size"

View file

@ -17,6 +17,18 @@
android:layout_width="@dimen/list_view_folder_thumbnail_size"
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
<ImageView
android:id="@+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/small_margin"
android:gravity="end"
android:background="@drawable/circle_black_background"
android:src="@drawable/ic_star_on_vector"
android:visibility="gone" />
<ImageView
android:id="@+id/medium_check"
android:layout_width="@dimen/selection_check_size"

View file

@ -22,11 +22,23 @@
android:src="@drawable/ic_play_outline_vector"
android:visibility="gone" />
<ImageView
android:id="@+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/small_margin"
android:gravity="end"
android:background="@drawable/circle_black_background"
android:src="@drawable/ic_star_on_vector"
android:visibility="gone" />
<TextView
android:id="@+id/video_duration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:ellipsize="end"
android:gravity="end"

View file

@ -17,6 +17,18 @@
android:layout_width="@dimen/list_view_folder_thumbnail_size"
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
<ImageView
android:id="@+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/small_margin"
android:gravity="end"
android:background="@drawable/circle_black_background"
android:src="@drawable/ic_star_on_vector"
android:visibility="gone" />
<ImageView
android:id="@+id/medium_check"
android:layout_width="@dimen/selection_check_size"