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
9a42141e
authored
Jul 09, 2020
by
insun
Committed by
Jaewan Kim
Jul 09, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Toggles subtitle button's image and content description accordingly
PiperOrigin-RevId: 320323388
parent
b1e9257d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
View file @
9a42141e
...
...
@@ -381,6 +381,10 @@ public class StyledPlayerControlView extends FrameLayout {
private
final
float
buttonAlphaDisabled
;
private
final
String
shuffleOnContentDescription
;
private
final
String
shuffleOffContentDescription
;
private
final
Drawable
subtitleOnButtonDrawable
;
private
final
Drawable
subtitleOffButtonDrawable
;
private
final
String
subtitleOnContentDescription
;
private
final
String
subtitleOffContentDescription
;
private
final
Drawable
fullScreenExitDrawable
;
private
final
Drawable
fullScreenEnterDrawable
;
private
final
String
fullScreenExitContentDescription
;
...
...
@@ -437,7 +441,7 @@ public class StyledPlayerControlView extends FrameLayout {
private
TrackNameProvider
trackNameProvider
;
// Relating to Bottom Bar Right View
@Nullable
private
View
subtitleButton
;
@Nullable
private
Image
View
subtitleButton
;
@Nullable
private
ImageView
fullScreenButton
;
@Nullable
private
View
settingsButton
;
...
...
@@ -666,6 +670,10 @@ public class StyledPlayerControlView extends FrameLayout {
needToHideBars
=
true
;
trackNameProvider
=
new
DefaultTrackNameProvider
(
getResources
());
subtitleOnButtonDrawable
=
resources
.
getDrawable
(
R
.
drawable
.
exo_styled_controls_subtitle_on
);
subtitleOffButtonDrawable
=
resources
.
getDrawable
(
R
.
drawable
.
exo_styled_controls_subtitle_off
);
subtitleOnContentDescription
=
resources
.
getString
(
R
.
string
.
exo_controls_cc_is_on
);
subtitleOffContentDescription
=
resources
.
getString
(
R
.
string
.
exo_controls_cc_is_off
);
textTrackSelectionAdapter
=
new
TextTrackSelectionAdapter
();
audioTrackSelectionAdapter
=
new
AudioTrackSelectionAdapter
();
...
...
@@ -2005,6 +2013,10 @@ public class StyledPlayerControlView extends FrameLayout {
.
setRendererDisabled
(
rendererIndex
,
true
);
}
checkNotNull
(
trackSelector
).
setParameters
(
parametersBuilder
);
if
(
showSubtitleButton
)
{
checkNotNull
(
subtitleButton
).
setImageDrawable
(
subtitleOffButtonDrawable
);
checkNotNull
(
subtitleButton
).
setContentDescription
(
subtitleOffContentDescription
);
}
settingsWindow
.
dismiss
();
}
}
...
...
@@ -2012,8 +2024,11 @@ public class StyledPlayerControlView extends FrameLayout {
}
@Override
public
void
updateSettingsSubtext
(
String
subtext
)
{
// Do nothing. Text track selection exists outside of Settings menu.
public
void
onTrackSelection
(
String
subtext
)
{
if
(
showSubtitleButton
)
{
checkNotNull
(
subtitleButton
).
setImageDrawable
(
subtitleOnButtonDrawable
);
checkNotNull
(
subtitleButton
).
setContentDescription
(
subtitleOnContentDescription
);
}
}
}
...
...
@@ -2056,7 +2071,7 @@ public class StyledPlayerControlView extends FrameLayout {
}
@Override
public
void
updateSettingsSubtext
(
String
subtext
)
{
public
void
onTrackSelection
(
String
subtext
)
{
settingsAdapter
.
updateSubTexts
(
SETTINGS_AUDIO_TRACK_SELECTION_POSITION
,
subtext
);
}
...
...
@@ -2127,7 +2142,7 @@ public class StyledPlayerControlView extends FrameLayout {
public
abstract
void
onBindViewHolderAtZeroPosition
(
TrackSelectionViewHolder
holder
);
public
abstract
void
updateSettingsSubtext
(
String
subtext
);
public
abstract
void
onTrackSelection
(
String
subtext
);
@Override
public
void
onBindViewHolder
(
TrackSelectionViewHolder
holder
,
int
position
)
{
...
...
@@ -2170,7 +2185,7 @@ public class StyledPlayerControlView extends FrameLayout {
}
}
checkNotNull
(
trackSelector
).
setParameters
(
parametersBuilder
);
updateSettingsSubtext
(
track
.
trackName
);
onTrackSelection
(
track
.
trackName
);
settingsWindow
.
dismiss
();
}
}
...
...
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