Commit 517cfb4c authored by Geoffrey Métais's avatar Geoffrey Métais

Truncate start ov video files in groups

See #431
parent aad4bf51
......@@ -90,7 +90,6 @@
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:maxLines="2"
android:singleLine="true"
android:paddingLeft="@dimen/half_default_margin"
android:paddingStart="@dimen/half_default_margin"
android:text="@{media.title}"
......
......@@ -95,7 +95,7 @@ public class VideoGridFragment extends SortableFragment<VideoListAdapter> implem
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAdapter = new VideoListAdapter(this);
mAdapter = new VideoListAdapter(this, mGroup != null);
if (savedInstanceState != null)
setGroup(savedInstanceState.getString(KEY_GROUP));
......
......@@ -36,6 +36,7 @@ import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.ImageView;
import android.widget.TextView;
import org.videolan.medialibrary.Tools;
import org.videolan.medialibrary.media.MediaLibraryItem;
......@@ -71,13 +72,15 @@ public class VideoListAdapter extends SortableAdapter<MediaWrapper, VideoListAda
private final ItemFilter mFilter = new ItemFilter();
private int mSelectionCount = 0;
private int mGridCardWidth = 0;
final boolean mGroup;
private boolean mIsSeenMediaMarkerVisible = true;
VideoListAdapter(IEventsHandler eventsHandler) {
VideoListAdapter(IEventsHandler eventsHandler, boolean group) {
super();
mEventsHandler = eventsHandler;
mIsSeenMediaMarkerVisible = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext()).getBoolean("media_seen", true);
mGroup = group;
}
@Override
......@@ -102,6 +105,9 @@ public class VideoListAdapter extends SortableAdapter<MediaWrapper, VideoListAda
fillView(holder, media);
holder.binding.setVariable(BR.media, media);
holder.selectView(media.hasStateFlags(MediaLibraryItem.FLAG_SELECTED));
final TextView titleView = holder.itemView.findViewById(R.id.ml_item_title);
titleView.setMaxLines(mGroup ? 1 : 2);
titleView.setEllipsize(mGroup ? TextUtils.TruncateAt.START : null);
}
@Override
......
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