[Android] Define stretchmode in XML
Geoffrey Métais
git at videolan.org
Wed Aug 12 14:54:55 CEST 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Aug 12 14:41:48 2015 +0200| [f336a326c703b2a981bc4285074ec0706c86d90f] | committer: Geoffrey Métais
Define stretchmode in XML
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f336a326c703b2a981bc4285074ec0706c86d90f
---
vlc-android/res/layout/video_grid.xml | 1 +
.../src/org/videolan/vlc/gui/video/VideoGridFragment.java | 11 -----------
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/vlc-android/res/layout/video_grid.xml b/vlc-android/res/layout/video_grid.xml
index b5e9801..db23892 100644
--- a/vlc-android/res/layout/video_grid.xml
+++ b/vlc-android/res/layout/video_grid.xml
@@ -18,6 +18,7 @@
android:numColumns="auto_fit"
android:fastScrollEnabled="true"
android:fadingEdge="none"
+ android:stretchMode="columnWidth"
android:gravity="center"
android:nextFocusUp="@+id/ml_menu_search"
android:nextFocusDown="@id/android:list"
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 8aa25e6..2438c6a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -89,15 +89,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
private static final int DELETE_MEDIA = 0;
private static final int DELETE_DURATION = 3000;
- protected static final String ACTION_SCAN_START = "org.videolan.vlc.gui.ScanStart";
- protected static final String ACTION_SCAN_STOP = "org.videolan.vlc.gui.ScanStop";
- protected static final int UPDATE_ITEM = 0;
-
- /* Constants used to switch from Grid to List and vice versa */
- //FIXME If you know a way to do this in pure XML please do it!
- private static final int GRID_STRETCH_MODE = GridView.STRETCH_COLUMN_WIDTH;
- private static final int LIST_STRETCH_MODE = GridView.STRETCH_COLUMN_WIDTH;
-
protected LinearLayout mLayoutFlipperLoading;
protected GridView mGridView;
protected TextView mTextViewNomedia;
@@ -264,14 +255,12 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
if (!listMode) {
sidePadding = (int) ((float)outMetrics.widthPixels / 100f * (float)Math.pow(outMetrics.density, 3) / 2f);
mGridView.setNumColumns(GridView.AUTO_FIT);
- mGridView.setStretchMode(GRID_STRETCH_MODE);
mGridView.setColumnWidth(res.getDimensionPixelSize(R.dimen.grid_card_width));
mGridView.setVerticalSpacing(res.getDimensionPixelSize(R.dimen.grid_card_vertical_spacing));
mVideoAdapter.setListMode(false);
} else {
sidePadding = res.getDimensionPixelSize(R.dimen.listview_side_padding);
mGridView.setNumColumns(1);
- mGridView.setStretchMode(LIST_STRETCH_MODE);
mGridView.setVerticalSpacing(0);
mGridView.setHorizontalSpacing(0);
mVideoAdapter.setListMode(true);
More information about the Android
mailing list