forked from Juby210/discord-jadx
100 lines
5 KiB
Java
100 lines
5 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 c0.z.d.m;
|
|
import com.discord.R;
|
|
import com.discord.databinding.SuggestedFriendViewBinding;
|
|
import com.discord.utilities.icon.IconUtils;
|
|
import com.discord.utilities.images.MGImages;
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
|
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(R.layout.suggested_friend_view, this);
|
|
int i2 = R.id.suggested_friend_avatar;
|
|
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(R.id.suggested_friend_avatar);
|
|
if (simpleDraweeView != null) {
|
|
i2 = R.id.suggested_friend_decline;
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) findViewById(R.id.suggested_friend_decline);
|
|
if (appCompatImageView != null) {
|
|
i2 = R.id.suggested_friend_public_name;
|
|
TextView textView = (TextView) findViewById(R.id.suggested_friend_public_name);
|
|
if (textView != null) {
|
|
i2 = R.id.suggested_friend_send_request;
|
|
AppCompatImageView appCompatImageView2 = (AppCompatImageView) findViewById(R.id.suggested_friend_send_request);
|
|
if (appCompatImageView2 != null) {
|
|
i2 = R.id.suggested_friend_username;
|
|
TextView textView2 = (TextView) findViewById(R.id.suggested_friend_username);
|
|
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.f2058c.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);
|
|
}
|
|
}
|