discord-jadx/app/src/main/java/c/a/y/z.java

100 lines
4.1 KiB
Java

package c.a.y;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextSwitcher;
import android.widget.TextView;
import c.a.i.c1;
import com.discord.api.message.reaction.MessageReaction;
import com.discord.utilities.textprocessing.node.EmojiNode;
import com.discord.utilities.view.text.SimpleDraweeSpanTextView;
import d0.z.d.m;
/* compiled from: ReactionView.kt */
public final class z extends LinearLayout {
public int i;
public Long j;
public MessageReaction k;
public final c1 l;
public z(Context context) {
super(context);
View inflate = LayoutInflater.from(getContext()).inflate(2131558649, (ViewGroup) this, false);
addView(inflate);
int i = 2131362799;
TextView textView = (TextView) inflate.findViewById(2131362799);
if (textView != null) {
i = 2131362800;
TextView textView2 = (TextView) inflate.findViewById(2131362800);
if (textView2 != null) {
i = 2131362801;
TextSwitcher textSwitcher = (TextSwitcher) inflate.findViewById(2131362801);
if (textSwitcher != null) {
i = 2131363080;
SimpleDraweeSpanTextView simpleDraweeSpanTextView = (SimpleDraweeSpanTextView) inflate.findViewById(2131363080);
if (simpleDraweeSpanTextView != null) {
c1 c1Var = new c1((LinearLayout) inflate, textView, textView2, textSwitcher, simpleDraweeSpanTextView);
m.checkNotNullExpressionValue(c1Var, "ReactionViewBinding.infl…rom(context), this, true)");
this.l = c1Var;
return;
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
private final void setIsMe(boolean z2) {
setActivated(z2);
setSelected(z2);
TextView textView = this.l.b;
m.checkNotNullExpressionValue(textView, "binding.counterText1");
textView.setActivated(z2);
TextView textView2 = this.l.f71c;
m.checkNotNullExpressionValue(textView2, "binding.counterText2");
textView2.setActivated(z2);
}
public final void a(MessageReaction messageReaction, long j, boolean z2) {
m.checkNotNullParameter(messageReaction, "reaction");
Long l = this.j;
boolean z3 = l == null || l == null || l.longValue() != j;
MessageReaction messageReaction2 = this.k;
int a = messageReaction.a();
c1 c1Var = this.l;
int i = this.i;
if (a != i) {
if (z3) {
c1Var.d.setCurrentText(String.valueOf(a));
} else {
if (a > i) {
TextSwitcher textSwitcher = c1Var.d;
textSwitcher.setInAnimation(textSwitcher.getContext(), 2130772022);
textSwitcher.setOutAnimation(textSwitcher.getContext(), 2130772024);
} else {
TextSwitcher textSwitcher2 = c1Var.d;
textSwitcher2.setInAnimation(textSwitcher2.getContext(), 2130772021);
textSwitcher2.setOutAnimation(textSwitcher2.getContext(), 2130772023);
}
c1Var.d.setText(String.valueOf(a));
}
this.i = a;
}
if (messageReaction2 == null || (!m.areEqual(messageReaction.b(), messageReaction2.b()))) {
EmojiNode.Companion companion = EmojiNode.Companion;
SimpleDraweeSpanTextView simpleDraweeSpanTextView = this.l.e;
m.checkNotNullExpressionValue(simpleDraweeSpanTextView, "binding.emojiTextView");
EmojiNode.Companion.renderEmoji$default(companion, simpleDraweeSpanTextView, messageReaction.b(), z2, 0, 4, null);
}
setIsMe(messageReaction.c());
this.k = messageReaction;
this.j = Long.valueOf(j);
}
public final MessageReaction getReaction() {
return this.k;
}
}