[Android] TV: Add util method to set overscan padding

Geoffrey Métais git at videolan.org
Fri May 27 17:54:31 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 27 17:10:43 2016 +0200| [f395f8774129da62343c155e512baa039230e094] | committer: Geoffrey Métais

TV: Add util method to set overscan padding

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

 vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
index d7e80d0..051e6fe 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
@@ -25,7 +25,9 @@ import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
 import android.support.v17.leanback.widget.Row;
+import android.view.View;
 
+import org.videolan.vlc.R;
 import org.videolan.vlc.gui.tv.audioplayer.AudioPlayerActivity;
 import org.videolan.vlc.gui.tv.browser.VerticalGridActivity;
 import org.videolan.vlc.gui.video.VideoPlayerActivity;
@@ -36,6 +38,12 @@ import java.util.ArrayList;
 
 public class TvUtil {
 
+    public static void applyOverscanMargin(Activity activity) {
+        View content = activity.findViewById(android.R.id.content);
+        int hm = activity.getResources().getDimensionPixelSize(R.dimen.tv_overscan_horizontal);
+        int vm = activity.getResources().getDimensionPixelSize(R.dimen.tv_overscan_vertical);
+        content.setPadding(hm, vm, hm, vm);
+    }
 
     public static void openMedia(Activity activity, Object item , Row row){
         if (item instanceof MediaWrapper) {



More information about the Android mailing list