2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.search;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.view.KeyEvent;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import com.discord.app.AppFragment;
|
|
|
|
import com.discord.stores.StoreSearch;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.search.strings.ContextSearchStringProvider;
|
|
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
|
|
|
import kotlin.jvm.functions.Function3;
|
|
|
|
/* compiled from: WidgetSearch.kt */
|
|
|
|
public final class WidgetSearch$configureSearchInput$1 extends o implements Function3<TextView, Integer, KeyEvent, Boolean> {
|
|
|
|
public final /* synthetic */ WidgetSearch this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public WidgetSearch$configureSearchInput$1(WidgetSearch widgetSearch) {
|
|
|
|
super(3);
|
|
|
|
this.this$0 = widgetSearch;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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, java.lang.Object] */
|
|
|
|
@Override // kotlin.jvm.functions.Function3
|
|
|
|
public /* bridge */ /* synthetic */ Boolean invoke(TextView textView, Integer num, KeyEvent keyEvent) {
|
|
|
|
return Boolean.valueOf(invoke(textView, num.intValue(), keyEvent));
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean invoke(TextView textView, int i, KeyEvent keyEvent) {
|
|
|
|
m.checkNotNullParameter(textView, "textView");
|
|
|
|
if (i != 2 && i != 3 && i != 6) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
AppFragment.hideKeyboard$default(this.this$0, null, 1, null);
|
|
|
|
StoreSearch search = StoreStream.Companion.getSearch();
|
2021-09-18 07:43:22 +00:00
|
|
|
TextInputLayout textInputLayout = WidgetSearch.access$getBinding$p(this.this$0).f1931c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(textInputLayout, "binding.widgetSearchInput");
|
|
|
|
String textOrEmpty = ViewExtensions.getTextOrEmpty(textInputLayout);
|
|
|
|
Context context = textView.getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "textView.context");
|
|
|
|
search.loadInitial(textOrEmpty, new ContextSearchStringProvider(context));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|