discord-jadx/app/src/main/java/defpackage/SpoilerSpan.java

46 lines
1.2 KiB
Java
Raw Normal View History

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-08 18:25:28 +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 */
2022-03-02 20:59:20 +00:00
/* loaded from: classes3.dex */
2021-06-27 20:44:35 +00:00
public final class SpoilerSpan extends BackgroundColorSpan {
public int j;
2021-12-17 22:03:14 +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-17 22:03:14 +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-17 22:03:14 +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-17 22:03:14 +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-17 22:03:14 +00:00
if (this.l) {
textPaint.bgColor = this.k;
2021-06-27 20:44:35 +00:00
return;
}
2021-12-17 22:03:14 +00:00
int i = this.j;
2021-06-27 20:44:35 +00:00
textPaint.bgColor = i;
textPaint.setColor(i);
}
}