71 lines
3.8 KiB
Java
71 lines
3.8 KiB
Java
package com.discord.widgets.chat.input;
|
|
|
|
import android.view.View;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import c.a.k.b;
|
|
import c.d.b.a.a;
|
|
import com.discord.R;
|
|
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.facebook.drawee.view.SimpleDraweeView;
|
|
import d0.z.d.m;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
/* compiled from: WidgetChatInputCategoriesAdapter.kt */
|
|
public final class ApplicationCategoryViewHolder extends RecyclerView.ViewHolder {
|
|
private final CommandCategoryItemBinding binding;
|
|
private final Function1<Application, Unit> onItemSelected;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: kotlin.jvm.functions.Function1<? super com.discord.models.commands.Application, kotlin.Unit> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ApplicationCategoryViewHolder(CommandCategoryItemBinding commandCategoryItemBinding, Function1<? super Application, Unit> function1) {
|
|
super(commandCategoryItemBinding.a);
|
|
m.checkNotNullParameter(commandCategoryItemBinding, "binding");
|
|
m.checkNotNullParameter(function1, "onItemSelected");
|
|
this.binding = commandCategoryItemBinding;
|
|
this.onItemSelected = function1;
|
|
}
|
|
|
|
public static final /* synthetic */ Function1 access$getOnItemSelected$p(ApplicationCategoryViewHolder applicationCategoryViewHolder) {
|
|
return applicationCategoryViewHolder.onItemSelected;
|
|
}
|
|
|
|
public final void bind(Application application, boolean z2) {
|
|
int i;
|
|
m.checkNotNullParameter(application, "application");
|
|
this.binding.b.setImageURI((String) null);
|
|
SimpleDraweeView simpleDraweeView = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.commandCategoryItemIcon");
|
|
IconUtils.setApplicationIcon(simpleDraweeView, application);
|
|
SimpleDraweeView simpleDraweeView2 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.commandCategoryItemIcon");
|
|
simpleDraweeView2.setSelected(z2);
|
|
View view = this.binding.f1617c.b;
|
|
m.checkNotNullExpressionValue(view, "binding.overline.express…CategorySelectionOverline");
|
|
view.setVisibility(z2 ? 0 : 8);
|
|
if (z2) {
|
|
SimpleDraweeView simpleDraweeView3 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView3, "binding.commandCategoryItemIcon");
|
|
i = ColorCompat.getThemedColor(simpleDraweeView3, (int) R.attr.colorInteractiveActive);
|
|
} else {
|
|
SimpleDraweeView simpleDraweeView4 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView4, "binding.commandCategoryItemIcon");
|
|
i = ColorCompat.getThemedColor(simpleDraweeView4, (int) R.attr.colorInteractiveNormal);
|
|
}
|
|
SimpleDraweeView simpleDraweeView5 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView5, "binding.commandCategoryItemIcon");
|
|
ColorCompatKt.tintWithColor(simpleDraweeView5, i);
|
|
SimpleDraweeView simpleDraweeView6 = this.binding.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView6, "binding.commandCategoryItemIcon");
|
|
simpleDraweeView6.setAlpha(z2 ? 1.0f : 0.5f);
|
|
this.itemView.setOnClickListener(new ApplicationCategoryViewHolder$bind$1(this, application));
|
|
View view2 = this.itemView;
|
|
m.checkNotNullExpressionValue(view2, "itemView");
|
|
view2.setContentDescription(b.h(a.x(this.itemView, "itemView", "itemView.context"), R.string.command_accessibility_desc_app_item, new Object[]{application.getName()}, null, 4));
|
|
}
|
|
}
|