50 lines
2.2 KiB
Java
50 lines
2.2 KiB
Java
package com.discord.widgets.channels;
|
|
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.widgets.channels.WidgetChannelSelector;
|
|
import d0.t.m;
|
|
import d0.t.n;
|
|
import d0.t.o;
|
|
import d0.t.u;
|
|
import j0.k.b;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
/* compiled from: WidgetChannelSelector.kt */
|
|
public final class WidgetChannelSelector$Model$Companion$get$1<T, R> implements b<Map<Long, ? extends Channel>, List<? extends WidgetChannelSelector.Model.Item>> {
|
|
public final /* synthetic */ WidgetChannelSelector.FilterFunction $filterFunction;
|
|
public final /* synthetic */ boolean $includeNoChannel;
|
|
|
|
public WidgetChannelSelector$Model$Companion$get$1(WidgetChannelSelector.FilterFunction filterFunction, boolean z2) {
|
|
this.$filterFunction = filterFunction;
|
|
this.$includeNoChannel = z2;
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
@Override // j0.k.b
|
|
public /* bridge */ /* synthetic */ List<? extends WidgetChannelSelector.Model.Item> call(Map<Long, ? extends Channel> map) {
|
|
return call((Map<Long, Channel>) map);
|
|
}
|
|
|
|
public final List<WidgetChannelSelector.Model.Item> call(Map<Long, Channel> map) {
|
|
Collection<Channel> values = map.values();
|
|
WidgetChannelSelector.FilterFunction filterFunction = this.$filterFunction;
|
|
ArrayList arrayList = new ArrayList();
|
|
for (T t : values) {
|
|
if (filterFunction.includeChannel(t)) {
|
|
arrayList.add(t);
|
|
}
|
|
}
|
|
List listOf = this.$includeNoChannel ? m.listOf(new WidgetChannelSelector.Model.Item(null, 0, null, 6, null)) : n.emptyList();
|
|
List<T> sortedWith = u.sortedWith(arrayList, AnimatableValueParser.K0(Channel.Companion));
|
|
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(sortedWith, 10));
|
|
for (T t2 : sortedWith) {
|
|
arrayList2.add(new WidgetChannelSelector.Model.Item(t2, 0, null, 6, null));
|
|
}
|
|
return u.plus((Collection) listOf, (Iterable) arrayList2);
|
|
}
|
|
}
|