mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
formatting
This commit is contained in:
parent
ec69977a1c
commit
8ac74a009e
3 changed files with 13 additions and 17 deletions
|
|
@ -324,22 +324,20 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
|
|||
if (style.bold && style.italic) {
|
||||
spannableText.setSpan(
|
||||
new StyleSpan(Typeface.BOLD_ITALIC),
|
||||
0,
|
||||
spannableText.length(),
|
||||
/* start= */0,
|
||||
/* end= */ spannableText.length(),
|
||||
SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
else if(style.bold){
|
||||
} else if (style.bold) {
|
||||
spannableText.setSpan(
|
||||
new StyleSpan(Typeface.BOLD),
|
||||
0,
|
||||
spannableText.length(),
|
||||
/* start= */0,
|
||||
/* end= */ spannableText.length(),
|
||||
SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
else if(style.italic){
|
||||
} else if (style.italic) {
|
||||
spannableText.setSpan(
|
||||
new StyleSpan(Typeface.ITALIC),
|
||||
0,
|
||||
spannableText.length(),
|
||||
/* start= */0,
|
||||
/* end= */ spannableText.length(),
|
||||
SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,10 +218,9 @@ import java.util.regex.Pattern;
|
|||
private static boolean parseBold(String bold) {
|
||||
try {
|
||||
int boldFlag = Integer.parseInt(bold);
|
||||
if(boldFlag == 1 || boldFlag == -1){
|
||||
if (boldFlag == 1 || boldFlag == -1) {
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
|
|
@ -233,10 +232,9 @@ import java.util.regex.Pattern;
|
|||
private static boolean parseItalic(String italic) {
|
||||
try {
|
||||
int italicFlag = Integer.parseInt(italic);
|
||||
if(italicFlag == 1 || italicFlag == -1){
|
||||
if (italicFlag == 1 || italicFlag == -1) {
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ public final class SsaDecoderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void decodeBoldItalic() throws IOException{
|
||||
public void decodeBoldItalic() throws IOException {
|
||||
SsaDecoder decoder = new SsaDecoder();
|
||||
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), STYLE_BOLD_ITALIC);
|
||||
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue