Commit 4d653151 authored by Geoffrey Métais's avatar Geoffrey Métais

Improve history items icon

parent c63059a8
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment