From bfc60e1694ba09876b47e44d0ae2841f8467184f Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 19 Feb 2019 18:53:26 +0000 Subject: [PATCH] Set vertical orientation by default in TrackSelectionView Horizontal orientation doesn't make sense. I thought about overriding the setter to throw something, but it's probably not worth the extra lines. PiperOrigin-RevId: 234632530 --- demos/main/src/main/res/layout/track_selection_dialog_tab.xml | 3 ++- .../com/google/android/exoplayer2/ui/TrackSelectionView.java | 2 ++ library/ui/src/main/res/layout/exo_track_selection_dialog.xml | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demos/main/src/main/res/layout/track_selection_dialog_tab.xml b/demos/main/src/main/res/layout/track_selection_dialog_tab.xml index 1827b4738b..33e69e5bee 100644 --- a/demos/main/src/main/res/layout/track_selection_dialog_tab.xml +++ b/demos/main/src/main/res/layout/track_selection_dialog_tab.xml @@ -16,9 +16,10 @@ + + diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/TrackSelectionView.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/TrackSelectionView.java index e95d70f026..7af1a905ef 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/TrackSelectionView.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/TrackSelectionView.java @@ -87,6 +87,8 @@ public class TrackSelectionView extends LinearLayout { public TrackSelectionView( Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) { super(context, attrs, defStyleAttr); + setOrientation(LinearLayout.VERTICAL); + overrides = new SparseArray<>(); // Don't save view hierarchy as it needs to be reinitialized with a call to init. diff --git a/library/ui/src/main/res/layout/exo_track_selection_dialog.xml b/library/ui/src/main/res/layout/exo_track_selection_dialog.xml index 2ad8e2ea9b..07f59c3a59 100644 --- a/library/ui/src/main/res/layout/exo_track_selection_dialog.xml +++ b/library/ui/src/main/res/layout/exo_track_selection_dialog.xml @@ -18,7 +18,6 @@ android:layout_height="match_parent">