[Android] Set advOptions width according to span count
Geoffrey Métais
git at videolan.org
Tue Jan 5 16:28:39 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 5 16:20:45 2016 +0100| [0173a445db8076b1eb518fbbc6391e1e61427b75] | committer: Geoffrey Métais
Set advOptions width according to span count
> https://code.videolan.org/videolan/vlc-android/commit/0173a445db8076b1eb518fbbc6391e1e61427b75
---
vlc-android/res/layout/fragment_advanced_options.xml | 2 +-
vlc-android/res/values/dimens.xml | 4 +---
vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/vlc-android/res/layout/fragment_advanced_options.xml b/vlc-android/res/layout/fragment_advanced_options.xml
index 707b78d..83c2bb3 100644
--- a/vlc-android/res/layout/fragment_advanced_options.xml
+++ b/vlc-android/res/layout/fragment_advanced_options.xml
@@ -2,5 +2,5 @@
<org.videolan.vlc.view.AutoFitRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:padding="20dp"/>
+ android:padding="@dimen/adv_options_margin"/>
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index c44c6e8..45d1fc8 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -32,9 +32,7 @@
<!-- Adv options -->
<dimen name="option_width">64dp</dimen>
<dimen name="option_height">72dp</dimen>
- <dimen name="adv_options_width">224dp</dimen>
- <dimen name="adv_options_height">300dp</dimen>
- <dimen name="adv_options_margin">24dp</dimen>
+ <dimen name="adv_options_margin">16dp</dimen>
<dimen name="dialog_time_picker_width">240dp</dimen>
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
index d8e3ff5..00cc63c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -158,7 +158,7 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
private void setDialogDimensions(int offset) {
if (getDialog() == null)
return;
- int dialogWidth = getResources().getDimensionPixelSize(R.dimen.adv_options_width) + mRecyclerView.getPaddingLeft()+ mRecyclerView.getRight();
+ int dialogWidth = getResources().getDimensionPixelSize(R.dimen.option_width) * SPAN_COUNT + mRecyclerView.getPaddingLeft()+ mRecyclerView.getRight();
int count = mAdapter.getItemCount()-offset;
int rows = offset + count / SPAN_COUNT;
More information about the Android
mailing list