discord-jadx/app/src/main/java/com/discord/utilities/spans/ClickableSpan.java

57 lines
2.3 KiB
Java

package com.discord.utilities.spans;
import android.text.TextPaint;
import android.view.View;
import d0.z.d.m;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: ClickableSpan.kt */
public final class ClickableSpan extends android.text.style.ClickableSpan {
private final Integer color;
private final Function1<View, Unit> onClickListener;
private final Function1<View, Unit> onLongPress;
private final boolean underline;
/* JADX DEBUG: Multi-variable search result rejected for r4v0, resolved type: kotlin.jvm.functions.Function1<? super android.view.View, kotlin.Unit> */
/* JADX DEBUG: Multi-variable search result rejected for r5v0, resolved type: kotlin.jvm.functions.Function1<? super android.view.View, kotlin.Unit> */
/* JADX WARN: Multi-variable type inference failed */
public ClickableSpan(Integer num, boolean z2, Function1<? super View, Unit> function1, Function1<? super View, Unit> function12) {
m.checkNotNullParameter(function12, "onClickListener");
this.color = num;
this.underline = z2;
this.onLongPress = function1;
this.onClickListener = function12;
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ ClickableSpan(Integer num, boolean z2, Function1 function1, Function1 function12, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(num, z2, (i & 4) != 0 ? null : function1, function12);
}
@Override // android.text.style.ClickableSpan
public void onClick(View view) {
m.checkNotNullParameter(view, "view");
this.onClickListener.invoke(view);
}
public final Unit onLongPress(View view) {
m.checkNotNullParameter(view, "view");
Function1<View, Unit> function1 = this.onLongPress;
if (function1 != null) {
return function1.invoke(view);
}
return null;
}
@Override // android.text.style.ClickableSpan, android.text.style.CharacterStyle
public void updateDrawState(TextPaint textPaint) {
m.checkNotNullParameter(textPaint, "drawState");
textPaint.setUnderlineText(this.underline);
Integer num = this.color;
if (num != null) {
textPaint.setColor(num.intValue());
}
}
}