60 lines
2.9 KiB
Java
60 lines
2.9 KiB
Java
|
package com.discord.utilities.textprocessing;
|
||
|
|
||
|
import android.text.SpannableStringBuilder;
|
||
|
import android.text.style.BackgroundColorSpan;
|
||
|
import com.discord.R;
|
||
|
import com.discord.simpleast.code.CodeNode;
|
||
|
import com.discord.simpleast.core.node.Node;
|
||
|
import com.discord.utilities.color.ColorCompat;
|
||
|
import com.discord.utilities.textprocessing.Rules;
|
||
|
import com.discord.utilities.textprocessing.node.BasicRenderContext;
|
||
|
import com.discord.utilities.textprocessing.node.BlockBackgroundNode;
|
||
|
import d0.z.d.m;
|
||
|
import d0.z.d.o;
|
||
|
import kotlin.jvm.functions.Function3;
|
||
|
/* compiled from: Rules.kt */
|
||
|
public final class Rules$createCodeBlockRule$1 extends o implements Function3<CodeNode<RC>, Boolean, S, Node<RC>> {
|
||
|
public static final Rules$createCodeBlockRule$1 INSTANCE = new Rules$createCodeBlockRule$1();
|
||
|
|
||
|
/* compiled from: Rules.kt */
|
||
|
/* renamed from: com.discord.utilities.textprocessing.Rules$createCodeBlockRule$1$1 reason: invalid class name */
|
||
|
public static final class AnonymousClass1 extends Node.a<RC> {
|
||
|
public final /* synthetic */ CodeNode $codeNode;
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public AnonymousClass1(CodeNode codeNode, Node[] nodeArr) {
|
||
|
super(nodeArr);
|
||
|
this.$codeNode = codeNode;
|
||
|
}
|
||
|
|
||
|
public void render(SpannableStringBuilder spannableStringBuilder, RC rc) {
|
||
|
m.checkNotNullParameter(spannableStringBuilder, "builder");
|
||
|
m.checkNotNullParameter(rc, "renderContext");
|
||
|
int length = spannableStringBuilder.length();
|
||
|
super.render(spannableStringBuilder, (SpannableStringBuilder) rc);
|
||
|
spannableStringBuilder.setSpan(new BackgroundColorSpan(ColorCompat.getThemedColor(rc.getContext(), (int) R.attr.theme_chat_code)), length, spannableStringBuilder.length(), 33);
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.simpleast.core.node.Node.a, com.discord.simpleast.core.node.Node
|
||
|
public /* bridge */ /* synthetic */ void render(SpannableStringBuilder spannableStringBuilder, Object obj) {
|
||
|
render(spannableStringBuilder, (SpannableStringBuilder) ((BasicRenderContext) obj));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public Rules$createCodeBlockRule$1() {
|
||
|
super(3);
|
||
|
}
|
||
|
|
||
|
public final Node<RC> invoke(CodeNode<RC> codeNode, boolean z2, S s2) {
|
||
|
m.checkNotNullParameter(codeNode, "codeNode");
|
||
|
m.checkNotNullParameter(s2, "state");
|
||
|
return !z2 ? new AnonymousClass1(codeNode, new Node[]{codeNode}) : new BlockBackgroundNode(s2.isInQuote(), codeNode);
|
||
|
}
|
||
|
|
||
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object, java.lang.Object] */
|
||
|
@Override // kotlin.jvm.functions.Function3
|
||
|
public /* bridge */ /* synthetic */ Object invoke(Object obj, Boolean bool, Object obj2) {
|
||
|
return invoke((CodeNode) obj, bool.booleanValue(), (boolean) ((Rules.BlockQuoteState) obj2));
|
||
|
}
|
||
|
}
|