[Android] Ensure maxlines attribute is respected

Geoffrey Métais git at videolan.org
Wed Dec 6 14:33:24 CET 2017


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

Ensure maxlines attribute is respected

(cherry picked from commit 655be79d0787859b505398a88e9fdfe291ab5977)

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

 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