[Android] Ensure maxlines attribute is respected

Geoffrey Métais git at videolan.org
Mon Dec 4 16:21:58 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Dec  4 16:21:21 2017 +0100| [655be79d0787859b505398a88e9fdfe291ab5977] | committer: Geoffrey Métais

Ensure maxlines attribute is respected

> https://code.videolan.org/videolan/vlc-android/commit/655be79d0787859b505398a88e9fdfe291ab5977
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index d20710fe4..0587035a2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -93,6 +93,10 @@ public class VideoListAdapter extends SortableAdapter<MediaWrapper, VideoListAda
             params.height = params.width*10/16;
             binding.getRoot().setLayoutParams(params);
         }
+        final TextView titleView = binding.getRoot().findViewById(R.id.ml_item_title);
+        titleView.setEllipsize(mGroup ? TextUtils.TruncateAt.START : null);
+        titleView.setSingleLine(mGroup);
+        titleView.setMaxLines(mGroup ? 1 : 2);
         return new ViewHolder(binding);
     }
 
@@ -105,10 +109,6 @@ 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);
-        titleView.setSingleLine(mGroup);
     }
 
     @Override



More information about the Android mailing list