Commit 4fdc8d2b authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Update videos list display

parent c9214156
......@@ -31,7 +31,7 @@
android:id="@+id/video_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/default_margin"
android:padding="@dimen/half_default_margin"
android:clipToPadding="false"
android:scrollbarStyle="outsideInset"
android:numColumns="auto_fit"
......
......@@ -66,8 +66,8 @@
android:layout_height="75dp"
vlc:layout_constraintStart_toStartOf="parent"
vlc:media="@{media}"
android:scaleType="fitXY"
android:background="@{cover}" />
android:scaleType="centerCrop"
android:src="@{cover}" />
<ImageView
android:id="@+id/ml_item_seen"
......@@ -87,7 +87,6 @@
vlc:layout_constraintEnd_toStartOf="@+id/item_more"
vlc:layout_constraintBottom_toTopOf="@+id/ml_item_resolution"
android:ellipsize="end"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:maxLines="2"
android:paddingLeft="@dimen/half_default_margin"
......@@ -116,13 +115,13 @@
android:layout_height="wrap_content"
vlc:layout_constraintStart_toEndOf="@+id/ml_item_thumbnail"
vlc:layout_constraintBottom_toTopOf="@+id/ml_item_progress"
android:fontFamily="sans-serif-light"
android:gravity="start"
android:paddingLeft="@dimen/half_default_margin"
android:paddingStart="@dimen/half_default_margin"
android:text="@{time}"
android:fontFamily="sans-serif-light"
android:layout_alignWithParentIfMissing="true"
android:textColor="?attr/list_subtitle"
android:textColor="?attr/list_title"
android:textSize="14sp"
tools:targetApi="jelly_bean" />
......@@ -133,13 +132,13 @@
vlc:layout_constraintBottom_toTopOf="@+id/ml_item_progress"
vlc:layout_constraintStart_toEndOf="@+id/ml_item_time"
vlc:layout_constraintEnd_toEndOf="parent"
android:paddingRight="@dimen/half_default_margin"
android:paddingEnd="@dimen/half_default_margin"
android:layout_alignWithParentIfMissing="true"
android:paddingRight="12dp"
android:paddingEnd="12dp"
android:fontFamily="sans-serif-light"
android:gravity="end"
android:text="@{resolution}"
android:textColor="?attr/list_subtitle"
android:textColor="?attr/list_title"
android:textSize="14sp"
tools:targetApi="jelly_bean" />
......
......@@ -37,7 +37,6 @@ import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.ContextMenu;
......@@ -78,7 +77,6 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosProvider> impl
private VideoListAdapter mAdapter;
private VideoGridBinding mBinding;
private String mGroup;
private DividerItemDecoration mDividerItemDecoration;
@Override
public void onCreate(Bundle savedInstanceState) {
......@@ -121,8 +119,6 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosProvider> impl
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mSwipeRefreshLayout.setOnRefreshListener(this);
mDividerItemDecoration = new DividerItemDecoration(requireActivity(), DividerItemDecoration.VERTICAL);
if (mAdapter.isListMode()) mBinding.videoGrid.addItemDecoration(mDividerItemDecoration);
mBinding.videoGrid.setAdapter(mAdapter);
}
......@@ -178,11 +174,7 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosProvider> impl
mAdapter.setGridCardWidth(mBinding.videoGrid.getColumnWidth());
}
mBinding.videoGrid.setNumColumns(listMode ? 1 : -1);
if (mAdapter.isListMode() != listMode) {
if (listMode) mBinding.videoGrid.addItemDecoration(mDividerItemDecoration);
else mBinding.videoGrid.removeItemDecoration(mDividerItemDecoration);
mAdapter.setListMode(listMode);
}
if (mAdapter.isListMode() != listMode) mAdapter.setListMode(listMode);
}
......
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