<div dir="ltr">I also have:<div><div>    <string name="force_list_portrait">No grid in portrait mode</string></div><div>    <string name="force_list_portrait_summary">Show videos in list instead of grid in portrait mode</string></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 19, 2014 at 6:26 PM, Edward Wang <span dir="ltr"><<a href="mailto:edward.c.wang@compdigitec.com" target="_blank">edward.c.wang@compdigitec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Hello,<br>
<br>
Le 19 novembre 2014 06:23:53 HNP, "Geoffrey Métais" <<a href="mailto:geoffrey.metais@gmail.com">geoffrey.metais@gmail.com</a>> a écrit :<br>
<span class="">>---<br>
>vlc-android/res/values/strings.xml                                | 2<br>
>++<br>
>vlc-android/res/xml/preferences.xml                               | 5<br>
>+++++<br>
>vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 8<br>
>++++++--<br>
> 3 files changed, 13 insertions(+), 2 deletions(-)<br>
><br>
>diff --git a/vlc-android/res/values/strings.xml<br>
>b/vlc-android/res/values/strings.xml<br>
>index bf6e2d4..2b00dfe 100644<br>
>--- a/vlc-android/res/values/strings.xml<br>
>+++ b/vlc-android/res/values/strings.xml<br>
>@@ -236,6 +236,8 @@<br>
><string name="enable_brightness_gesture_summary">Control brightness by<br>
>gesture during video playback</string><br>
>     <string name="enable_jump_buttons">Enable jump buttons</string><br>
><string name="enable_jump_buttons_summary">Show backward and forward<br>
>buttons on the video interface</string><br>
>+    <string name="force_list_portrait">Videos list in<br>
>protrait</string><br>
<br>
</span>Show videos as list in portrait<br>
<span class=""><br>
>+    <string name="force_list_portrait_summary">Videos will always be<br>
>displayed in list mode instead of grid in portrait mode</string><br>
<br>
</span>Display videos as a list instead of a grid in portrait mode.<br>
<div class="HOEnZb"><div class="h5"><br>
>    <string name="audio_title_alignment">Audio title alignment</string><br>
>     <string name="enable_headset_detection">Detect headset</string><br>
><string name="enable_headset_detection_summary">Pause on headset<br>
>removal; resume on headset insertion</string><br>
>diff --git a/vlc-android/res/xml/preferences.xml<br>
>b/vlc-android/res/xml/preferences.xml<br>
>index 8ec773f..63adfef 100644<br>
>--- a/vlc-android/res/xml/preferences.xml<br>
>+++ b/vlc-android/res/xml/preferences.xml<br>
>@@ -48,6 +48,11 @@<br>
>             </PreferenceCategory><br>
> <PreferenceCategory android:title="@string/interface_other_category" ><br>
>                 <CheckBoxPreference<br>
>+                    android:defaultValue="false"<br>
>+                    android:key="force_list_protrait"<br>
>+<br>
>android:summary="@string/force_list_portrait_summary"<br>
>+                    android:title="@string/force_list_portrait" /><br>
>+                <CheckBoxPreference<br>
>                     android:defaultValue="true"<br>
>                     android:key="enable_brightness_gesture"<br>
>            android:summary="@string/enable_brightness_gesture_summary"<br>
>diff --git<br>
>a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java<br>
>b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java<br>
>index 5b450dc..ad0ffb2 100644<br>
>--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java<br>
>+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java<br>
>@@ -55,6 +55,7 @@ import android.os.Build;<br>
> import android.os.Bundle;<br>
> import android.os.Handler;<br>
> import android.os.Message;<br>
>+import android.preference.PreferenceManager;<br>
> import android.support.v4.app.FragmentActivity;<br>
> import android.support.v7.app.ActionBarActivity;<br>
> import android.util.DisplayMetrics;<br>
>@@ -211,8 +212,10 @@ public class VideoGridFragment extends<br>
>SherlockGridFragment implements ISortable<br>
>             Log.w(TAG, "Unable to setup the view");<br>
>             return;<br>
>         }<br>
>-<br>
>         Resources res = getResources();<br>
>+        boolean listMode = res.getBoolean(R.bool.list_mode);<br>
>+        listMode |= getResources().getConfiguration().orientation ==<br>
>Configuration.ORIENTATION_PORTRAIT &&<br>
>+<br>
>PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("force_list_protrait",<br>
>false);<br>
>         // Compute the left/right padding dynamically<br>
>         DisplayMetrics outMetrics = new DisplayMetrics();<br>
>getActivity().getWindowManager().getDefaultDisplay().getMetrics(outMetrics);<br>
>@@ -222,7 +225,7 @@ public class VideoGridFragment extends<br>
>SherlockGridFragment implements ISortable<br>
>                 sidePadding, mGridView.getPaddingBottom());<br>
><br>
>         // Select between grid or list<br>
>-            if (!res.getBoolean(R.bool.list_mode)) {<br>
>+            if (!listMode) {<br>
>             mGridView.setNumColumns(GridView.AUTO_FIT);<br>
>             mGridView.setStretchMode(GRID_STRETCH_MODE);<br>
>mGridView.setColumnWidth(res.getDimensionPixelSize(R.dimen.grid_card_width));<br>
>@@ -231,6 +234,7 @@ public class VideoGridFragment extends<br>
>SherlockGridFragment implements ISortable<br>
>         } else {<br>
>             mGridView.setNumColumns(1);<br>
>             mGridView.setStretchMode(LIST_STRETCH_MODE);<br>
>+            mGridView.setVerticalSpacing(0);<br>
>             mVideoAdapter.setListMode(true);<br>
>         }<br>
>     }<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Android mailing list<br>
<a href="mailto:Android@videolan.org">Android@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/android" target="_blank">https://mailman.videolan.org/listinfo/android</a><br>
</div></div></blockquote></div><br></div>