105 lines
4.2 KiB
Java
105 lines
4.2 KiB
Java
package com.discord.utilities.search.query.node.filter;
|
|
|
|
import android.content.Context;
|
|
import android.graphics.Typeface;
|
|
import android.text.SpannableStringBuilder;
|
|
import androidx.core.app.NotificationCompat;
|
|
import c.d.b.a.a;
|
|
import c0.z.d.m;
|
|
import com.discord.R;
|
|
import com.discord.utilities.font.FontUtils;
|
|
import com.discord.utilities.search.query.FilterType;
|
|
import com.discord.utilities.search.query.node.QueryNode;
|
|
import com.discord.utilities.spans.TypefaceSpanCompat;
|
|
import com.discord.widgets.chat.input.MentionUtilsKt;
|
|
/* compiled from: FilterNode.kt */
|
|
public final class FilterNode extends QueryNode {
|
|
private final FilterType filterType;
|
|
private final CharSequence text;
|
|
|
|
public FilterNode(FilterType filterType, CharSequence charSequence) {
|
|
m.checkNotNullParameter(filterType, "filterType");
|
|
m.checkNotNullParameter(charSequence, NotificationCompat.MessagingStyle.Message.KEY_TEXT);
|
|
this.filterType = filterType;
|
|
this.text = charSequence;
|
|
}
|
|
|
|
public static /* synthetic */ FilterNode copy$default(FilterNode filterNode, FilterType filterType, CharSequence charSequence, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
filterType = filterNode.filterType;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
charSequence = filterNode.getText();
|
|
}
|
|
return filterNode.copy(filterType, charSequence);
|
|
}
|
|
|
|
public final FilterType component1() {
|
|
return this.filterType;
|
|
}
|
|
|
|
public final CharSequence component2() {
|
|
return getText();
|
|
}
|
|
|
|
public final FilterNode copy(FilterType filterType, CharSequence charSequence) {
|
|
m.checkNotNullParameter(filterType, "filterType");
|
|
m.checkNotNullParameter(charSequence, NotificationCompat.MessagingStyle.Message.KEY_TEXT);
|
|
return new FilterNode(filterType, charSequence);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof FilterNode)) {
|
|
return false;
|
|
}
|
|
FilterNode filterNode = (FilterNode) obj;
|
|
return m.areEqual(this.filterType, filterNode.filterType) && m.areEqual(getText(), filterNode.getText());
|
|
}
|
|
|
|
public final FilterType getFilterType() {
|
|
return this.filterType;
|
|
}
|
|
|
|
@Override // com.discord.utilities.search.query.node.QueryNode
|
|
public CharSequence getText() {
|
|
return this.text;
|
|
}
|
|
|
|
public int hashCode() {
|
|
FilterType filterType = this.filterType;
|
|
int i = 0;
|
|
int hashCode = (filterType != null ? filterType.hashCode() : 0) * 31;
|
|
CharSequence text = getText();
|
|
if (text != null) {
|
|
i = text.hashCode();
|
|
}
|
|
return hashCode + i;
|
|
}
|
|
|
|
/* JADX DEBUG: TODO: convert one arg to string using `String.valueOf()`, args: [(wrap: java.lang.CharSequence : 0x0025: INVOKE (r2v0 java.lang.CharSequence) = (r3v0 'this' com.discord.utilities.search.query.node.filter.FilterNode A[IMMUTABLE_TYPE, THIS]) type: VIRTUAL call: com.discord.utilities.search.query.node.filter.FilterNode.getText():java.lang.CharSequence), (wrap: char : ?: SGET com.discord.widgets.chat.input.MentionUtilsKt.EMOJIS_AND_STICKERS_CHAR char)] */
|
|
public void render(SpannableStringBuilder spannableStringBuilder, Context context) {
|
|
m.checkNotNullParameter(spannableStringBuilder, "builder");
|
|
m.checkNotNullParameter(context, "renderContext");
|
|
Typeface themedFont = FontUtils.INSTANCE.getThemedFont(context, R.attr.font_primary_bold);
|
|
TypefaceSpanCompat typefaceSpanCompat = themedFont != null ? new TypefaceSpanCompat(themedFont) : null;
|
|
int length = spannableStringBuilder.length();
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(getText());
|
|
sb.append(MentionUtilsKt.EMOJIS_AND_STICKERS_CHAR);
|
|
spannableStringBuilder.append((CharSequence) sb.toString());
|
|
spannableStringBuilder.setSpan(typefaceSpanCompat, length, spannableStringBuilder.length(), 33);
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder O = a.O("FilterNode(filterType=");
|
|
O.append(this.filterType);
|
|
O.append(", text=");
|
|
O.append(getText());
|
|
O.append(")");
|
|
return O.toString();
|
|
}
|
|
}
|