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
This commit is contained in:
olly 2019-02-19 18:53:26 +00:00 committed by Andrew Lewis
parent b68fda0322
commit bfc60e1694
3 changed files with 4 additions and 2 deletions

View File

@ -16,9 +16,10 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.google.android.exoplayer2.ui.TrackSelectionView <com.google.android.exoplayer2.ui.TrackSelectionView
android:id="@+id/download_dialog_track_selection_view" android:id="@+id/download_dialog_track_selection_view"
android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
</ScrollView> </ScrollView>

View File

@ -87,6 +87,8 @@ public class TrackSelectionView extends LinearLayout {
public TrackSelectionView( public TrackSelectionView(
Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) { Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
setOrientation(LinearLayout.VERTICAL);
overrides = new SparseArray<>(); overrides = new SparseArray<>();
// Don't save view hierarchy as it needs to be reinitialized with a call to init. // Don't save view hierarchy as it needs to be reinitialized with a call to init.

View File

@ -18,7 +18,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.exoplayer2.ui.TrackSelectionView android:id="@+id/exo_track_selection_view" <com.google.android.exoplayer2.ui.TrackSelectionView android:id="@+id/exo_track_selection_view"
android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>