2021-06-27 20:44:35 +00:00
|
|
|
package defpackage;
|
|
|
|
|
|
|
|
import android.text.TextPaint;
|
|
|
|
import android.text.style.BackgroundColorSpan;
|
|
|
|
import androidx.annotation.ColorInt;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
2021-06-27 20:44:35 +00:00
|
|
|
/* compiled from: SpoilerSpan.kt */
|
|
|
|
/* renamed from: SpoilerSpan reason: default package */
|
|
|
|
public final class SpoilerSpan extends BackgroundColorSpan {
|
|
|
|
public int j;
|
2021-12-02 18:53:44 +00:00
|
|
|
public int k;
|
|
|
|
public boolean l;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
public SpoilerSpan() {
|
|
|
|
super(0);
|
|
|
|
this.j = 0;
|
2021-12-02 18:53:44 +00:00
|
|
|
this.k = 0;
|
|
|
|
this.l = false;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public SpoilerSpan(@ColorInt int i, @ColorInt int i2, boolean z2) {
|
|
|
|
super(i);
|
2021-12-02 18:53:44 +00:00
|
|
|
this.j = i;
|
|
|
|
this.k = i2;
|
|
|
|
this.l = z2;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.text.style.BackgroundColorSpan
|
|
|
|
public int getBackgroundColor() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.l ? this.k : this.j;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.text.style.BackgroundColorSpan, android.text.style.CharacterStyle
|
|
|
|
public void updateDrawState(TextPaint textPaint) {
|
|
|
|
m.checkNotNullParameter(textPaint, "textPaint");
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.l) {
|
|
|
|
textPaint.bgColor = this.k;
|
2021-06-27 20:44:35 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
int i = this.j;
|
2021-06-27 20:44:35 +00:00
|
|
|
textPaint.bgColor = i;
|
|
|
|
textPaint.setColor(i);
|
|
|
|
}
|
|
|
|
}
|