From 8f88e48f8d361f9a757361aa2c86b328d310940d Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 9 Sep 2024 11:44:59 -0500 Subject: [PATCH] Fix autocomplete disable setting (cherry picked from commit 887b71ffadb0afa7cac2b96d401a7af589e91cc1) --- .../eu/siacs/conversations/ui/ConversationFragment.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 0f86543e38..029d195112 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -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.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;