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
f16f8e59
authored
Sep 16, 2020
by
olly
Committed by
Oliver Woodman
Sep 16, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Replace duration strings with plurals
PiperOrigin-RevId: 332014290
parent
a3cd36be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
library/ui/src/main/res/values/strings.xml
library/ui/src/main/res/values/styles.xml
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
View file @
f16f8e59
...
...
@@ -1159,13 +1159,14 @@ public class StyledPlayerControlView extends FrameLayout {
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
rewindMs
=
((
DefaultControlDispatcher
)
controlDispatcher
).
getRewindIncrementMs
();
}
long
rewindSec
=
rewindMs
/
1_000
;
int
rewindSec
=
(
int
)
(
rewindMs
/
1_000
)
;
if
(
rewindButtonTextView
!=
null
)
{
rewindButtonTextView
.
setText
(
String
.
valueOf
(
rewindSec
));
}
if
(
rewindButton
!=
null
)
{
rewindButton
.
setContentDescription
(
resources
.
getString
(
R
.
string
.
exo_controls_rewind_by_amount_description
,
rewindSec
));
resources
.
getQuantityString
(
R
.
plurals
.
exo_controls_rewind_by_amount_description
,
rewindSec
,
rewindSec
));
}
}
...
...
@@ -1173,14 +1174,16 @@ public class StyledPlayerControlView extends FrameLayout {
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
fastForwardMs
=
((
DefaultControlDispatcher
)
controlDispatcher
).
getFastForwardIncrementMs
();
}
long
fastForwardSec
=
fastForwardMs
/
1_000
;
int
fastForwardSec
=
(
int
)
(
fastForwardMs
/
1_000
)
;
if
(
fastForwardButtonTextView
!=
null
)
{
fastForwardButtonTextView
.
setText
(
String
.
valueOf
(
fastForwardSec
));
}
if
(
fastForwardButton
!=
null
)
{
fastForwardButton
.
setContentDescription
(
resources
.
getString
(
R
.
string
.
exo_controls_fastforward_by_amount_description
,
fastForwardSec
));
resources
.
getQuantityString
(
R
.
plurals
.
exo_controls_fastforward_by_amount_description
,
fastForwardSec
,
fastForwardSec
));
}
}
...
...
library/ui/src/main/res/values/strings.xml
View file @
f16f8e59
...
...
@@ -43,11 +43,17 @@
<!-- Description for a media control button that causes playback to be rewound. [CHAR LIMIT=30] -->
<string
name=
"exo_controls_rewind_description"
>
Rewind
</string>
<!-- Description for a media control button that causes playback to be rewound a specified number of seconds. [CHAR LIMIT=30] -->
<string
name=
"exo_controls_rewind_by_amount_description"
>
Rewind
<xliff:g
id=
"rewind_amount"
example=
"10"
>
%d
</xliff:g>
seconds
</string>
<plurals
name=
"exo_controls_rewind_by_amount_description"
>
<item
quantity=
"one"
>
Rewind
<xliff:g
id=
"rewind_amount"
example=
"1"
>
%d
</xliff:g>
second
</item>
<item
quantity=
"other"
>
Rewind
<xliff:g
id=
"rewind_amount"
example=
"30"
>
%d
</xliff:g>
seconds
</item>
</plurals>
<!-- Description for a media control button that causes playback to be fast-forwarded. [CHAR LIMIT=30] -->
<string
name=
"exo_controls_fastforward_description"
>
Fast forward
</string>
<!-- Description for a media control button that causes playback to be fast-forwarded a specified number of seconds. [CHAR_LIMIT=55] -->
<string
name=
"exo_controls_fastforward_by_amount_description"
>
Fast forward
<xliff:g
id=
"fastforward_amount"
example=
"30"
>
%d
</xliff:g>
seconds
</string>
<plurals
name=
"exo_controls_fastforward_by_amount_description"
>
<item
quantity=
"one"
>
Fast forward
<xliff:g
id=
"fastforward_amount"
example=
"1"
>
%d
</xliff:g>
second
</item>
<item
quantity=
"other"
>
Fast forward
<xliff:g
id=
"fastforward_amount"
example=
"30"
>
%d
</xliff:g>
seconds
</item>
</plurals>
<!-- Description for a button that controls the repeat mode of a media playback. In this mode media is not repeated. [CHAR LIMIT=30] -->
<string
name=
"exo_controls_repeat_off_description"
>
Repeat none
</string>
<!-- Description for a button that controls the repeat mode of a media playback. In this mode the current piece of media is repeated. [CHAR LIMIT=30] -->
...
...
library/ui/src/main/res/values/styles.xml
View file @
f16f8e59
...
...
@@ -90,14 +90,12 @@
<style
name=
"ExoStyledControls.Button.Center.FfwdWithAmount"
>
<item
name=
"android:background"
>
@drawable/exo_ripple_ffwd
</item>
<item
name=
"android:contentDescription"
>
@string/exo_controls_fastforward_by_amount_description
</item>
<item
name=
"android:gravity"
>
center|bottom
</item>
<item
name=
"android:paddingBottom"
>
@dimen/exo_icon_padding_bottom
</item>
<item
name=
"android:textAppearance"
>
@style/ExoStyledControls.ButtonText
</item>
</style>
<style
name=
"ExoStyledControls.Button.Center.RewWithAmount"
>
<item
name=
"android:background"
>
@drawable/exo_ripple_rew
</item>
<item
name=
"android:contentDescription"
>
@string/exo_controls_rewind_by_amount_description
</item>
<item
name=
"android:gravity"
>
center|bottom
</item>
<item
name=
"android:paddingBottom"
>
@dimen/exo_icon_padding_bottom
</item>
<item
name=
"android:textAppearance"
>
@style/ExoStyledControls.ButtonText
</item>
...
...
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