[Android] Fix ML settings page display on TV

Geoffrey Métais git at videolan.org
Mon Oct 30 15:28:52 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Oct 30 15:27:26 2017 +0100| [2268e06c98a7688f30e3347395c479507cdf7312] | committer: Geoffrey Métais

Fix ML settings page display on TV

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

 .../src/org/videolan/vlc/gui/SecondaryActivity.java   | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java b/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java
index 7f326881a..28584b02b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java
@@ -27,7 +27,6 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.support.design.widget.AppBarLayout;
 import android.support.design.widget.CoordinatorLayout;
-import android.support.design.widget.Snackbar;
 import android.support.v4.app.Fragment;
 import android.view.MenuItem;
 import android.view.View;
@@ -39,6 +38,7 @@ import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.gui.audio.AudioAlbumsSongsFragment;
 import org.videolan.vlc.gui.audio.AudioBrowserFragment;
 import org.videolan.vlc.gui.browser.StorageBrowserFragment;
+import org.videolan.vlc.gui.helpers.UiTools;
 import org.videolan.vlc.gui.preferences.PreferencesActivity;
 import org.videolan.vlc.gui.tv.TvUtil;
 import org.videolan.vlc.gui.video.VideoGridFragment;
@@ -62,15 +62,16 @@ public class SecondaryActivity extends ContentActivity {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.secondary);
 
+        final View fph = findViewById(R.id.fragment_placeholder);
+        final CoordinatorLayout.LayoutParams params =
+                (CoordinatorLayout.LayoutParams) fph.getLayoutParams();
+
         if (VLCApplication.showTvUi()) {
             TvUtil.applyOverscanMargin(this);
-        } else {
-            final View fph = findViewById(R.id.fragment_placeholder);
-            final CoordinatorLayout.LayoutParams params =
-                    (CoordinatorLayout.LayoutParams) fph.getLayoutParams();
+            params.topMargin = getResources().getDimensionPixelSize(UiTools.getResourceFromAttribute(this, R.attr.actionBarSize));
+        } else
             params.setBehavior(new AppBarLayout.ScrollingViewBehavior());
-            fph.requestLayout();
-        }
+        fph.requestLayout();
 
         initAudioPlayerContainerActivity();
         getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@@ -83,8 +84,8 @@ public class SecondaryActivity extends ContentActivity {
                 return;
             }
             getSupportFragmentManager().beginTransaction()
-            .add(R.id.fragment_placeholder, mFragment)
-            .commit();
+                    .add(R.id.fragment_placeholder, mFragment)
+                    .commit();
         }
     }
 



More information about the Android mailing list