discord-jadx/app/src/main/java/com/discord/widgets/chat/input/applicationcommands/SelectedAppCommandOptionAda...

72 lines
4.2 KiB
Java

package com.discord.widgets.chat.input.applicationcommands;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.discord.databinding.ViewAppcommandsOptionparamListitemBinding;
import com.discord.models.commands.ApplicationCommandOption;
import com.discord.utilities.color.ColorCompat;
import com.discord.utilities.mg_recycler.MGRecyclerViewHolder;
import d0.z.d.m;
/* compiled from: SelectedApplicationCommandAdapter.kt */
public final class SelectedAppCommandOptionAdapterItem extends MGRecyclerViewHolder<SelectedApplicationCommandAdapter, SelectedApplicationCommandItem> {
private final ViewAppcommandsOptionparamListitemBinding binding;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public SelectedAppCommandOptionAdapterItem(SelectedApplicationCommandAdapter selectedApplicationCommandAdapter) {
super(2131558725, selectedApplicationCommandAdapter);
m.checkNotNullParameter(selectedApplicationCommandAdapter, "adapter");
View view = this.itemView;
TextView textView = (TextView) view.findViewById(2131361974);
if (textView != null) {
ViewAppcommandsOptionparamListitemBinding viewAppcommandsOptionparamListitemBinding = new ViewAppcommandsOptionparamListitemBinding((FrameLayout) view, textView);
m.checkNotNullExpressionValue(viewAppcommandsOptionparamListitemBinding, "ViewAppcommandsOptionpar…temBinding.bind(itemView)");
this.binding = viewAppcommandsOptionparamListitemBinding;
return;
}
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(2131361974)));
}
public static final /* synthetic */ SelectedApplicationCommandAdapter access$getAdapter$p(SelectedAppCommandOptionAdapterItem selectedAppCommandOptionAdapterItem) {
return (SelectedApplicationCommandAdapter) selectedAppCommandOptionAdapterItem.adapter;
}
public void onConfigure(int i, SelectedApplicationCommandItem selectedApplicationCommandItem) {
int i2;
m.checkNotNullParameter(selectedApplicationCommandItem, "data");
super.onConfigure(i, (int) selectedApplicationCommandItem);
ApplicationCommandOption option = selectedApplicationCommandItem.getOption();
if (option != null) {
TextView textView = this.binding.b;
m.checkNotNullExpressionValue(textView, "binding.appcommandsOptiontitleTitle");
textView.setText(option.getName());
int i3 = selectedApplicationCommandItem.getHighlighted() ? 2131231014 : 2131231015;
if (selectedApplicationCommandItem.getHighlighted()) {
TextView textView2 = this.binding.b;
m.checkNotNullExpressionValue(textView2, "binding.appcommandsOptiontitleTitle");
i2 = ColorCompat.getThemedColor(textView2, 2130968932);
} else if (selectedApplicationCommandItem.getError()) {
TextView textView3 = this.binding.b;
m.checkNotNullExpressionValue(textView3, "binding.appcommandsOptiontitleTitle");
i2 = ColorCompat.getColor(textView3, 2131100324);
} else {
TextView textView4 = this.binding.b;
m.checkNotNullExpressionValue(textView4, "binding.appcommandsOptiontitleTitle");
i2 = ColorCompat.getThemedColor(textView4, 2130968932);
}
if (!selectedApplicationCommandItem.getCompleted() || selectedApplicationCommandItem.getHighlighted()) {
TextView textView5 = this.binding.b;
m.checkNotNullExpressionValue(textView5, "binding.appcommandsOptiontitleTitle");
textView5.setAlpha(1.0f);
} else {
TextView textView6 = this.binding.b;
m.checkNotNullExpressionValue(textView6, "binding.appcommandsOptiontitleTitle");
textView6.setAlpha(0.5f);
}
this.binding.b.setBackgroundResource(i3);
this.binding.b.setTextColor(i2);
this.itemView.setOnClickListener(new SelectedAppCommandOptionAdapterItem$onConfigure$$inlined$let$lambda$1(option, this, selectedApplicationCommandItem));
}
}
}