37 lines
1.9 KiB
Java
37 lines
1.9 KiB
Java
package com.discord.widgets.chat.input;
|
|
|
|
import android.text.Editable;
|
|
import android.text.TextUtils;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.time.ClockFactory;
|
|
import com.discord.utilities.view.text.TextWatcher;
|
|
import d0.z.d.m;
|
|
/* compiled from: WidgetChatInputEditText.kt */
|
|
public final class WidgetChatInputEditText$setOnTextChangedListener$1 extends TextWatcher {
|
|
private boolean empty = true;
|
|
public final /* synthetic */ WidgetChatInputEditText this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetChatInputEditText$setOnTextChangedListener$1(WidgetChatInputEditText widgetChatInputEditText) {
|
|
super(null, null, null, 7, null);
|
|
this.this$0 = widgetChatInputEditText;
|
|
}
|
|
|
|
@Override // com.discord.utilities.view.text.TextWatcher, android.text.TextWatcher
|
|
public void afterTextChanged(Editable editable) {
|
|
m.checkNotNullParameter(editable, "s");
|
|
super.afterTextChanged(editable);
|
|
this.this$0.saveText();
|
|
WidgetChatInputEditText.access$getChatInputCommands$p(this.this$0).onTextChanged(editable.toString());
|
|
boolean isEmpty = TextUtils.isEmpty(editable);
|
|
if (this.empty != isEmpty) {
|
|
this.empty = isEmpty;
|
|
WidgetChatInputEditText.access$getEmptyTextSubject$p(this.this$0).onNext(Boolean.valueOf(isEmpty));
|
|
}
|
|
boolean isTypingCommand = WidgetChatInputEditText.access$getChatInputCommands$p(this.this$0).getIsTypingCommand(editable.toString());
|
|
if (WidgetChatInputEditText.access$getLastTypingEmissionMillis$p(this.this$0) - ClockFactory.get().currentTimeMillis() < ((long) -10000) && !isEmpty && !isTypingCommand) {
|
|
WidgetChatInputEditText.access$setLastTypingEmissionMillis$p(this.this$0, ClockFactory.get().currentTimeMillis());
|
|
StoreStream.Companion.getUsersTyping().setUserTyping(this.this$0.getChannelId());
|
|
}
|
|
}
|
|
}
|