46 lines
2.6 KiB
Java
46 lines
2.6 KiB
Java
package com.discord.widgets.chat.list.adapter;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.Resources;
|
|
import android.view.View;
|
|
import android.widget.TextView;
|
|
import com.discord.databinding.WidgetChatListAdapterItemResultCountBinding;
|
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
|
import com.discord.widgets.chat.list.entries.ChatListEntry;
|
|
import com.discord.widgets.chat.list.entries.SearchResultCountEntry;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
/* compiled from: WidgetChatListAdapterItemSearchResultCount.kt */
|
|
public final class WidgetChatListAdapterItemSearchResultCount extends WidgetChatListItem {
|
|
private final WidgetChatListAdapterItemResultCountBinding binding;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetChatListAdapterItemSearchResultCount(WidgetChatListAdapter widgetChatListAdapter) {
|
|
super(2131558949, widgetChatListAdapter);
|
|
m.checkNotNullParameter(widgetChatListAdapter, "adapter");
|
|
View view = this.itemView;
|
|
Objects.requireNonNull(view, "rootView");
|
|
TextView textView = (TextView) view;
|
|
WidgetChatListAdapterItemResultCountBinding widgetChatListAdapterItemResultCountBinding = new WidgetChatListAdapterItemResultCountBinding(textView, textView);
|
|
m.checkNotNullExpressionValue(widgetChatListAdapterItemResultCountBinding, "WidgetChatListAdapterIte…untBinding.bind(itemView)");
|
|
this.binding = widgetChatListAdapterItemResultCountBinding;
|
|
}
|
|
|
|
@Override // com.discord.widgets.chat.list.adapter.WidgetChatListItem
|
|
public void onConfigure(int i, ChatListEntry chatListEntry) {
|
|
m.checkNotNullParameter(chatListEntry, "data");
|
|
super.onConfigure(i, chatListEntry);
|
|
int totalResults = ((SearchResultCountEntry) chatListEntry).getTotalResults();
|
|
TextView textView = this.binding.b;
|
|
m.checkNotNullExpressionValue(textView, "binding.resultCount");
|
|
TextView textView2 = this.binding.b;
|
|
m.checkNotNullExpressionValue(textView2, "binding.resultCount");
|
|
Resources resources = textView2.getResources();
|
|
m.checkNotNullExpressionValue(resources, "binding.resultCount.resources");
|
|
TextView textView3 = this.binding.b;
|
|
m.checkNotNullExpressionValue(textView3, "binding.resultCount");
|
|
Context context = textView3.getContext();
|
|
m.checkNotNullExpressionValue(context, "binding.resultCount.context");
|
|
textView.setText(StringResourceUtilsKt.getQuantityString(resources, context, 2131755341, totalResults, Integer.valueOf(totalResults)));
|
|
}
|
|
}
|