46 lines
2.1 KiB
Java
46 lines
2.1 KiB
Java
package com.discord.widgets.chat.input;
|
|
|
|
import d0.t.c0;
|
|
import d0.z.d.o;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.ranges.IntRange;
|
|
/* compiled from: WidgetChatInputAutocomplete.kt */
|
|
public final class WidgetChatInputAutocomplete$onScrollVisibleMentions$1 extends o implements Function2<Integer, Integer, Unit> {
|
|
public final /* synthetic */ Function1 $onScrollVisibleMentions;
|
|
public final /* synthetic */ WidgetChatInputAutocomplete this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetChatInputAutocomplete$onScrollVisibleMentions$1(WidgetChatInputAutocomplete widgetChatInputAutocomplete, Function1 function1) {
|
|
super(2);
|
|
this.this$0 = widgetChatInputAutocomplete;
|
|
this.$onScrollVisibleMentions = function1;
|
|
}
|
|
|
|
/* 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, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public /* bridge */ /* synthetic */ Unit invoke(Integer num, Integer num2) {
|
|
invoke(num.intValue(), num2.intValue());
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(int i, int i2) {
|
|
Function1 function1 = this.$onScrollVisibleMentions;
|
|
if (function1 != null) {
|
|
int min = Math.min(i2, WidgetChatInputAutocomplete.access$getMentionsAdapter$p(this.this$0).getItemCount() - 1);
|
|
if (i >= 0 && min >= i) {
|
|
IntRange intRange = new IntRange(i, min);
|
|
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(intRange, 10));
|
|
Iterator<Integer> it = intRange.iterator();
|
|
while (it.hasNext()) {
|
|
arrayList.add(WidgetChatInputAutocomplete.access$getMentionsAdapter$p(this.this$0).getItem(((c0) it).nextInt()));
|
|
}
|
|
function1.invoke(arrayList);
|
|
}
|
|
}
|
|
}
|
|
}
|