discord-jadx/app/src/main/java/com/discord/widgets/friends/SuggestedFriendView.java

100 lines
4.8 KiB
Java

package com.discord.widgets.friends;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.discord.databinding.SuggestedFriendViewBinding;
import com.discord.utilities.icon.IconUtils;
import com.discord.utilities.images.MGImages;
import com.facebook.drawee.view.SimpleDraweeView;
import d0.z.d.m;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: SuggestedFriendView.kt */
public final class SuggestedFriendView extends ConstraintLayout {
private final SuggestedFriendViewBinding binding;
public SuggestedFriendView(Context context) {
this(context, null, 0, 6, null);
}
public SuggestedFriendView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0, 4, null);
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public SuggestedFriendView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
m.checkNotNullParameter(context, "context");
LayoutInflater.from(context).inflate(2131558682, this);
int i2 = 2131365257;
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(2131365257);
if (simpleDraweeView != null) {
i2 = 2131365258;
AppCompatImageView appCompatImageView = (AppCompatImageView) findViewById(2131365258);
if (appCompatImageView != null) {
i2 = 2131365259;
TextView textView = (TextView) findViewById(2131365259);
if (textView != null) {
i2 = 2131365260;
AppCompatImageView appCompatImageView2 = (AppCompatImageView) findViewById(2131365260);
if (appCompatImageView2 != null) {
i2 = 2131365261;
TextView textView2 = (TextView) findViewById(2131365261);
if (textView2 != null) {
SuggestedFriendViewBinding suggestedFriendViewBinding = new SuggestedFriendViewBinding(this, simpleDraweeView, appCompatImageView, textView, appCompatImageView2, textView2);
m.checkNotNullExpressionValue(suggestedFriendViewBinding, "SuggestedFriendViewBindi…ater.from(context), this)");
this.binding = suggestedFriendViewBinding;
return;
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i2)));
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ SuggestedFriendView(Context context, AttributeSet attributeSet, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
}
public final void setAvatarUrl(long j, Integer num, String str) {
Long valueOf = Long.valueOf(j);
SimpleDraweeView simpleDraweeView = this.binding.b;
m.checkNotNullExpressionValue(simpleDraweeView, "binding.suggestedFriendAvatar");
String forUser = IconUtils.getForUser(valueOf, str, num, false, Integer.valueOf(simpleDraweeView.getHeight()));
SimpleDraweeView simpleDraweeView2 = this.binding.b;
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.suggestedFriendAvatar");
IconUtils.setIcon$default(simpleDraweeView2, forUser, 0, (Function1) null, (MGImages.ChangeDetector) null, 28, (Object) null);
}
public final void setOnDeclineClicked(Function0<Unit> function0) {
m.checkNotNullParameter(function0, "onDeclineClicked");
this.binding.f1637c.setOnClickListener(new SuggestedFriendView$setOnDeclineClicked$1(function0));
}
public final void setOnSendClicked(Function0<Unit> function0) {
m.checkNotNullParameter(function0, "onSendClicked");
this.binding.e.setOnClickListener(new SuggestedFriendView$setOnSendClicked$1(function0));
}
public final void setPublicName(String str) {
TextView textView = this.binding.d;
m.checkNotNullExpressionValue(textView, "binding.suggestedFriendPublicName");
textView.setText(str);
}
public final void setUsername(String str) {
m.checkNotNullParameter(str, "username");
TextView textView = this.binding.f;
m.checkNotNullExpressionValue(textView, "binding.suggestedFriendUsername");
textView.setText(str);
}
}