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
b5c85956
authored
Jan 15, 2016
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Plain Diff
Resolve merge conflict
parents
284b7e7f
e6132ed7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
library/src/main/java/com/google/android/exoplayer/text/ttml/TtmlColorParser.java
library/src/main/java/com/google/android/exoplayer/text/ttml/TtmlColorParser.java
View file @
b5c85956
...
@@ -89,12 +89,17 @@ import java.util.regex.Pattern;
...
@@ -89,12 +89,17 @@ import java.util.regex.Pattern;
Assertions
.
checkArgument
(!
TextUtils
.
isEmpty
(
colorExpression
));
Assertions
.
checkArgument
(!
TextUtils
.
isEmpty
(
colorExpression
));
colorExpression
=
colorExpression
.
replace
(
" "
,
""
);
colorExpression
=
colorExpression
.
replace
(
" "
,
""
);
if
(
colorExpression
.
charAt
(
0
)
==
'#'
)
{
if
(
colorExpression
.
charAt
(
0
)
==
'#'
)
{
// Use a long to avoid rollovers on #
ff
XXXXXX
// Use a long to avoid rollovers on #
FF
XXXXXX
long
color
=
Long
.
parseLong
(
colorExpression
.
substring
(
1
),
16
);
long
color
=
Long
.
parseLong
(
colorExpression
.
substring
(
1
),
16
);
if
(
colorExpression
.
length
()
==
7
)
{
if
(
colorExpression
.
length
()
==
7
)
{
// Set the alpha value
// Set the alpha value
color
|=
0x00000000FF000000
;
color
|=
0x00000000FF000000
;
}
else
if
(
colorExpression
.
length
()
!=
9
)
{
}
else
if
(
colorExpression
.
length
()
==
9
)
{
// We have #RRGGBBAA, but we need #AARRGGBB
int
alpha
=
(
int
)
color
&
0x00000000000000FF
;
color
>>=
8
;
color
|=
alpha
<<
24
;
}
else
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
}
}
return
(
int
)
color
;
return
(
int
)
color
;
...
...
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