TtmlStyle.smali
.class final Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/android/exoplayer2/text/ttml/TtmlStyle$FontSizeUnit;,
Lcom/google/android/exoplayer2/text/ttml/TtmlStyle$StyleFlags;
}
.end annotation
# static fields
.field public static final FONT_SIZE_UNIT_EM:I = 0x2
.field public static final FONT_SIZE_UNIT_PERCENT:I = 0x3
.field public static final FONT_SIZE_UNIT_PIXEL:I = 0x1
.field private static final OFF:I = 0x0
.field private static final ON:I = 0x1
.field public static final STYLE_BOLD:I = 0x1
.field public static final STYLE_BOLD_ITALIC:I = 0x3
.field public static final STYLE_ITALIC:I = 0x2
.field public static final STYLE_NORMAL:I = 0x0
.field public static final UNSPECIFIED:I = -0x1
# instance fields
.field private backgroundColor:I
.field private bold:I
.field private fontColor:I
.field private fontFamily:Ljava/lang/String;
.field private fontSize:F
.field private fontSizeUnit:I
.field private hasBackgroundColor:Z
.field private hasFontColor:Z
.field private id:Ljava/lang/String;
.field private inheritableStyle:Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.field private italic:I
.field private linethrough:I
.field private textAlign:Landroid/text/Layout$Alignment;
.field private underline:I
# direct methods
.method public constructor <init>()V
.registers 2
.line 69
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, -0x1
.line 70
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->linethrough:I
.line 71
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->underline:I
.line 72
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->bold:I
.line 73
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->italic:I
.line 74
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSizeUnit:I
return-void
.end method
.method private inherit(Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;Z)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 5
if-eqz p1, :cond_5b
.line 191
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasFontColor:Z
if-nez v0, :cond_f
iget-boolean v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasFontColor:Z
if-eqz v0, :cond_f
.line 192
iget v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontColor:I
invoke-virtual {p0, v0}, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->setFontColor(I)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.line 194
:cond_f
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->bold:I
const/4 v1, -0x1
if-ne v0, v1, :cond_18
.line 195
iget v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->bold:I
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->bold:I
.line 197
:cond_18
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->italic:I
if-ne v0, v1, :cond_20
.line 198
iget v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->italic:I
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->italic:I
.line 200
:cond_20
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontFamily:Ljava/lang/String;
if-nez v0, :cond_28
.line 201
iget-object v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontFamily:Ljava/lang/String;
iput-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontFamily:Ljava/lang/String;
.line 203
:cond_28
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->linethrough:I
if-ne v0, v1, :cond_30
.line 204
iget v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->linethrough:I
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->linethrough:I
.line 206
:cond_30
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->underline:I
if-ne v0, v1, :cond_38
.line 207
iget v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->underline:I
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->underline:I
.line 209
:cond_38
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->textAlign:Landroid/text/Layout$Alignment;
if-nez v0, :cond_40
.line 210
iget-object v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->textAlign:Landroid/text/Layout$Alignment;
iput-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->textAlign:Landroid/text/Layout$Alignment;
.line 212
:cond_40
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSizeUnit:I
if-ne v0, v1, :cond_4c
.line 213
iget v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSizeUnit:I
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSizeUnit:I
.line 214
iget v0, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSize:F
iput v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSize:F
:cond_4c
if-eqz p2, :cond_5b
.line 217
iget-boolean p2, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasBackgroundColor:Z
if-nez p2, :cond_5b
iget-boolean p2, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasBackgroundColor:Z
if-eqz p2, :cond_5b
.line 218
iget p1, p1, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->backgroundColor:I
invoke-virtual {p0, p1}, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->setBackgroundColor(I)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
:cond_5b
return-object p0
.end method
# virtual methods
.method public final chain(Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 3
const/4 v0, 0x1
.line 186
invoke-direct {p0, p1, v0}, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inherit(Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;Z)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
move-result-object p1
return-object p1
.end method
.method public final getBackgroundColor()I
.registers 3
.line 152
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasBackgroundColor:Z
if-eqz v0, :cond_7
.line 155
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->backgroundColor:I
return v0
.line 153
:cond_7
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Background color has not been defined."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final getFontColor()I
.registers 3
.line 134
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasFontColor:Z
if-eqz v0, :cond_7
.line 137
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontColor:I
return v0
.line 135
:cond_7
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Font color has not been defined."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final getFontFamily()Ljava/lang/String;
.registers 2
.line 124
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontFamily:Ljava/lang/String;
return-object v0
.end method
.method public final getFontSize()F
.registers 2
.line 257
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSize:F
return v0
.end method
.method public final getFontSizeUnit()I
.registers 2
.line 253
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSizeUnit:I
return v0
.end method
.method public final getId()Ljava/lang/String;
.registers 2
.line 230
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->id:Ljava/lang/String;
return-object v0
.end method
.method public final getStyle()I
.registers 5
.line 84
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->bold:I
const/4 v1, -0x1
if-ne v0, v1, :cond_a
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->italic:I
if-ne v0, v1, :cond_a
return v1
.line 87
:cond_a
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->bold:I
const/4 v1, 0x0
const/4 v2, 0x1
if-ne v0, v2, :cond_12
const/4 v0, 0x1
goto :goto_13
:cond_12
const/4 v0, 0x0
:goto_13
iget v3, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->italic:I
if-ne v3, v2, :cond_18
const/4 v1, 0x2
:cond_18
or-int/2addr v0, v1
return v0
.end method
.method public final getTextAlign()Landroid/text/Layout$Alignment;
.registers 2
.line 234
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->textAlign:Landroid/text/Layout$Alignment;
return-object v0
.end method
.method public final hasBackgroundColor()Z
.registers 2
.line 165
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasBackgroundColor:Z
return v0
.end method
.method public final hasFontColor()Z
.registers 2
.line 148
iget-boolean v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasFontColor:Z
return v0
.end method
.method public final inherit(Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 3
const/4 v0, 0x0
.line 176
invoke-direct {p0, p1, v0}, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inherit(Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;Z)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
move-result-object p1
return-object p1
.end method
.method public final isLinethrough()Z
.registers 3
.line 92
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->linethrough:I
const/4 v1, 0x1
if-ne v0, v1, :cond_6
return v1
:cond_6
const/4 v0, 0x0
return v0
.end method
.method public final isUnderline()Z
.registers 3
.line 102
iget v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->underline:I
const/4 v1, 0x1
if-ne v0, v1, :cond_6
return v1
:cond_6
const/4 v0, 0x0
return v0
.end method
.method public final setBackgroundColor(I)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 2
.line 159
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->backgroundColor:I
const/4 p1, 0x1
.line 160
iput-boolean p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasBackgroundColor:Z
return-object p0
.end method
.method public final setBold(Z)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 3
.line 112
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inheritableStyle:Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
if-nez v0, :cond_6
const/4 v0, 0x1
goto :goto_7
:cond_6
const/4 v0, 0x0
:goto_7
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Assertions;->checkState(Z)V
.line 113
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->bold:I
return-object p0
.end method
.method public final setFontColor(I)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 4
.line 141
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inheritableStyle:Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
const/4 v1, 0x1
if-nez v0, :cond_7
const/4 v0, 0x1
goto :goto_8
:cond_7
const/4 v0, 0x0
:goto_8
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Assertions;->checkState(Z)V
.line 142
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontColor:I
.line 143
iput-boolean v1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->hasFontColor:Z
return-object p0
.end method
.method public final setFontFamily(Ljava/lang/String;)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 3
.line 128
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inheritableStyle:Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
if-nez v0, :cond_6
const/4 v0, 0x1
goto :goto_7
:cond_6
const/4 v0, 0x0
:goto_7
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Assertions;->checkState(Z)V
.line 129
iput-object p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontFamily:Ljava/lang/String;
return-object p0
.end method
.method public final setFontSize(F)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 2
.line 243
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSize:F
return-object p0
.end method
.method public final setFontSizeUnit(I)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 2
.line 248
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->fontSizeUnit:I
return-object p0
.end method
.method public final setId(Ljava/lang/String;)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 2
.line 225
iput-object p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->id:Ljava/lang/String;
return-object p0
.end method
.method public final setItalic(Z)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 3
.line 118
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inheritableStyle:Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
if-nez v0, :cond_6
const/4 v0, 0x1
goto :goto_7
:cond_6
const/4 v0, 0x0
:goto_7
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Assertions;->checkState(Z)V
.line 119
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->italic:I
return-object p0
.end method
.method public final setLinethrough(Z)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 3
.line 96
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inheritableStyle:Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
if-nez v0, :cond_6
const/4 v0, 0x1
goto :goto_7
:cond_6
const/4 v0, 0x0
:goto_7
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Assertions;->checkState(Z)V
.line 97
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->linethrough:I
return-object p0
.end method
.method public final setTextAlign(Landroid/text/Layout$Alignment;)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 2
.line 238
iput-object p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->textAlign:Landroid/text/Layout$Alignment;
return-object p0
.end method
.method public final setUnderline(Z)Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
.registers 3
.line 106
iget-object v0, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->inheritableStyle:Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;
if-nez v0, :cond_6
const/4 v0, 0x1
goto :goto_7
:cond_6
const/4 v0, 0x0
:goto_7
invoke-static {v0}, Lcom/google/android/exoplayer2/util/Assertions;->checkState(Z)V
.line 107
iput p1, p0, Lcom/google/android/exoplayer2/text/ttml/TtmlStyle;->underline:I
return-object p0
.end method