Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a4754bb7
authored
Mar 06, 2019
by
olly
Committed by
Oliver Woodman
Mar 06, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Don't show track selection tabs if there's only one
PiperOrigin-RevId: 237025639
parent
3500f07b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
demos/main/src/main/java/com/google/android/exoplayer2/demo/TrackSelectionDialog.java
demos/main/src/main/java/com/google/android/exoplayer2/demo/TrackSelectionDialog.java
View file @
a4754bb7
...
...
@@ -58,7 +58,7 @@ public final class TrackSelectionDialog extends DialogFragment {
private
DialogInterface
.
OnDismissListener
onDismissListener
;
/**
* Creates and initialize
d
a dialog with a {@link DefaultTrackSelector} and automatically updates
* Creates and initialize
s
a dialog with a {@link DefaultTrackSelector} and automatically updates
* the track selector's parameters when tracks are selected.
*
* @param trackSelector A {@link DefaultTrackSelector}.
...
...
@@ -104,7 +104,7 @@ public final class TrackSelectionDialog extends DialogFragment {
public
TrackSelectionDialog
()
{
tabFragments
=
new
SparseArray
<>();
tabTitles
=
new
ArrayList
<>();
// Retain instance across
orientation changes to prevent lo
osing access to init data.
// Retain instance across
activity re-creation to prevent l
osing access to init data.
setRetainInstance
(
true
);
}
...
...
@@ -211,6 +211,7 @@ public final class TrackSelectionDialog extends DialogFragment {
Button
okButton
=
dialogView
.
findViewById
(
R
.
id
.
track_selection_dialog_ok_button
);
viewPager
.
setAdapter
(
new
FragmentAdapter
(
getChildFragmentManager
()));
tabLayout
.
setupWithViewPager
(
viewPager
);
tabLayout
.
setVisibility
(
tabFragments
.
size
()
>
1
?
View
.
VISIBLE
:
View
.
GONE
);
cancelButton
.
setOnClickListener
(
view
->
dismiss
());
okButton
.
setOnClickListener
(
view
->
{
...
...
@@ -271,7 +272,7 @@ public final class TrackSelectionDialog extends DialogFragment {
/* package */
List
<
SelectionOverride
>
overrides
;
public
TrackSelectionViewFragment
()
{
// Retain instance across
orientation changes to prevent lo
osing access to init data.
// Retain instance across
activity re-creation to prevent l
osing access to init data.
setRetainInstance
(
true
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment