Skip to content
Snippets Groups Projects
Commit 012b5045 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Improve history items icon

parent ebfa7fc0
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,8 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@{cover}"
android:src="@{cover}"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
......
......@@ -90,7 +90,7 @@ public class HistoryAdapter extends DiffUtilAdapter<MediaWrapper, HistoryAdapter
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
final MediaWrapper media = getItem(position);
boolean isSelected = media.hasStateFlags(MediaLibraryItem.FLAG_SELECTED);
final boolean isSelected = media.hasStateFlags(MediaLibraryItem.FLAG_SELECTED);
holder.binding.setMedia(media);
holder.binding.setCover(ImageLoaderKt.getMediaIconDrawable(holder.itemView.getContext(), media.getType()));
holder.selectView(isSelected);
......
......@@ -66,9 +66,8 @@ fun getAudioIconDrawable(context: Context?, type: Int): BitmapDrawable? = contex
}
fun getMediaIconDrawable(context: Context, type: Int): BitmapDrawable? = when (type) {
MediaWrapper.TYPE_AUDIO -> UiTools.getDefaultAudioDrawable(context)
MediaWrapper.TYPE_VIDEO -> UiTools.getDefaultVideoDrawable(context)
else -> null
else -> UiTools.getDefaultAudioDrawable(context)
}
private var placeholderTvBg : Drawable? = null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment