Fix autocomplete disable setting

(cherry picked from commit 887b71ffadb0afa7cac2b96d401a7af589e91cc1)
This commit is contained in:
Stephen Paul Weber 2024-09-09 11:44:59 -05:00 committed by Arne
parent 4c8e550f03
commit 8f88e48f8d

View file

@ -1610,6 +1610,9 @@ public class ConversationFragment extends XmppFragment
return true;
});
if (!activity.xmppConnectionService.getBooleanPreference("message_autocomplete", R.bool.message_autocomplete)) return binding.getRoot();
// After here should be only autocomplete setup stuff
Autocomplete.<MucOptions.User>on(binding.textinput)
.with(activity.getDrawable(R.drawable.background_message_bubble))
.with(new CharPolicy('@'))
@ -1633,6 +1636,8 @@ public class ConversationFragment extends XmppFragment
@Override
protected void onQuery(@Nullable CharSequence query) {
if (!activity.xmppConnectionService.getBooleanPreference("message_autocomplete", R.bool.message_autocomplete)) return;
getRecyclerView().getItemAnimator().endAnimations();
final var allUsers = conversation.getMucOptions().getUsers();
if (!conversation.getMucOptions().getUsersByRole(MucOptions.Role.MODERATOR).isEmpty()) {
@ -1724,6 +1729,8 @@ public class ConversationFragment extends XmppFragment
@Override
protected void onQuery(@Nullable CharSequence query) {
if (!activity.xmppConnectionService.getBooleanPreference("message_autocomplete", R.bool.message_autocomplete)) return;
emojiDebounce.removeCallbacksAndMessages(null);
emojiDebounce.postDelayed(() -> {
if (getRecyclerView() == null) return;