[Android] Update videos list display

Geoffrey Métais git at videolan.org
Wed May 2 17:53:57 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed May  2 17:53:34 2018 +0200| [4fdc8d2b3d787c7014fcf00a7e53767f0aecd466] | committer: Geoffrey Métais

Update videos list display

> https://code.videolan.org/videolan/vlc-android/commit/4fdc8d2b3d787c7014fcf00a7e53767f0aecd466
---

 vlc-android/res/layout/video_grid.xml                     |  2 +-
 vlc-android/res/layout/video_list_card.xml                | 15 +++++++--------
 .../src/org/videolan/vlc/gui/video/VideoGridFragment.java | 10 +---------
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/vlc-android/res/layout/video_grid.xml b/vlc-android/res/layout/video_grid.xml
index b45ab0da7..4e183dc95 100644
--- a/vlc-android/res/layout/video_grid.xml
+++ b/vlc-android/res/layout/video_grid.xml
@@ -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"
diff --git a/vlc-android/res/layout/video_list_card.xml b/vlc-android/res/layout/video_list_card.xml
index 208655475..455161f96 100644
--- a/vlc-android/res/layout/video_list_card.xml
+++ b/vlc-android/res/layout/video_list_card.xml
@@ -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" />
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index d14c247be..145b0da87 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -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);
     }
 
 



More information about the Android mailing list