79 lines
4.4 KiB
Java
79 lines
4.4 KiB
Java
package com.discord.widgets.chat.input;
|
|
|
|
import android.view.View;
|
|
import android.widget.FrameLayout;
|
|
import c.a.i.n;
|
|
import c.a.l.b;
|
|
import c.d.b.a.a;
|
|
import com.discord.databinding.CommandCategoryItemBinding;
|
|
import com.discord.models.commands.Application;
|
|
import com.discord.utilities.color.ColorCompat;
|
|
import com.discord.utilities.color.ColorCompatKt;
|
|
import com.discord.utilities.icon.IconUtils;
|
|
import com.discord.utilities.mg_recycler.MGRecyclerViewHolder;
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
|
import d0.z.d.m;
|
|
/* compiled from: WidgetChatInputCategoriesAdapter.kt */
|
|
public final class CommandCategoryViewHolder extends MGRecyclerViewHolder<WidgetChatInputCategoriesAdapter, CommandCategoryItem> {
|
|
private final CommandCategoryItemBinding binding;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public CommandCategoryViewHolder(WidgetChatInputCategoriesAdapter widgetChatInputCategoriesAdapter) {
|
|
super(2131558445, widgetChatInputCategoriesAdapter);
|
|
m.checkNotNullParameter(widgetChatInputCategoriesAdapter, "adapter");
|
|
View view = this.itemView;
|
|
int i = 2131362669;
|
|
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) view.findViewById(2131362669);
|
|
if (simpleDraweeView != null) {
|
|
i = 2131364168;
|
|
View findViewById = view.findViewById(2131364168);
|
|
if (findViewById != null) {
|
|
CommandCategoryItemBinding commandCategoryItemBinding = new CommandCategoryItemBinding((FrameLayout) view, simpleDraweeView, new n(findViewById, findViewById));
|
|
m.checkNotNullExpressionValue(commandCategoryItemBinding, "CommandCategoryItemBinding.bind(itemView)");
|
|
this.binding = commandCategoryItemBinding;
|
|
return;
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(i)));
|
|
}
|
|
|
|
public static final /* synthetic */ WidgetChatInputCategoriesAdapter access$getAdapter$p(CommandCategoryViewHolder commandCategoryViewHolder) {
|
|
return (WidgetChatInputCategoriesAdapter) commandCategoryViewHolder.adapter;
|
|
}
|
|
|
|
public void onConfigure(int i, CommandCategoryItem commandCategoryItem) {
|
|
int i2;
|
|
m.checkNotNullParameter(commandCategoryItem, "data");
|
|
super.onConfigure(i, (int) commandCategoryItem);
|
|
Application application = commandCategoryItem.getApplication();
|
|
SimpleDraweeView simpleDraweeView = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.commandCategoryItemIcon");
|
|
IconUtils.setApplicationIcon$default(simpleDraweeView, application, false, 4, null);
|
|
SimpleDraweeView simpleDraweeView2 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.commandCategoryItemIcon");
|
|
simpleDraweeView2.setSelected(commandCategoryItem.isSelected());
|
|
View view = this.binding.f1597c.b;
|
|
m.checkNotNullExpressionValue(view, "binding.overline.express…CategorySelectionOverline");
|
|
view.setVisibility(commandCategoryItem.isSelected() ? 0 : 8);
|
|
if (commandCategoryItem.isSelected()) {
|
|
SimpleDraweeView simpleDraweeView3 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView3, "binding.commandCategoryItemIcon");
|
|
i2 = ColorCompat.getThemedColor(simpleDraweeView3, 2130968946);
|
|
} else {
|
|
SimpleDraweeView simpleDraweeView4 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView4, "binding.commandCategoryItemIcon");
|
|
i2 = ColorCompat.getThemedColor(simpleDraweeView4, 2130968949);
|
|
}
|
|
SimpleDraweeView simpleDraweeView5 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView5, "binding.commandCategoryItemIcon");
|
|
ColorCompatKt.tintWithColor(simpleDraweeView5, i2);
|
|
SimpleDraweeView simpleDraweeView6 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView6, "binding.commandCategoryItemIcon");
|
|
simpleDraweeView6.setAlpha(commandCategoryItem.isSelected() ? 1.0f : 0.5f);
|
|
this.itemView.setOnClickListener(new CommandCategoryViewHolder$onConfigure$1(this, commandCategoryItem));
|
|
View view2 = this.itemView;
|
|
m.checkNotNullExpressionValue(view2, "itemView");
|
|
view2.setContentDescription(b.g(a.T(this.itemView, "itemView", "itemView.context"), 2131887424, new Object[]{application.getName()}, null, 4));
|
|
}
|
|
}
|