~singpolyma/cheogram-android

9f101650e830f39347fbb8c35833f43d2ec7467f — Stephen Paul Weber 8 months ago 9c84a49
Option to disable message composing autocomplete

Such as emoji
M src/cheogram/res/values/strings.xml => src/cheogram/res/values/strings.xml +2 -0
@@ 41,6 41,8 @@
    <string name="you_are_not_participating">You are muted</string>
    <string name="pref_follow_thread_in_channel">Auto-follow thread in channels</string>
    <string name="pref_follow_thread_in_channel_summary">Set the thread marker to match the message currently being looked at</string>
    <string name="pref_message_autocomplete">Autocomplete when composing messages</string>
    <string name="pref_message_autocomplete_summary">For example, complete emoji starting with :</string>
    <string name="notify_only_when_highlighted_or_replied">Notify for mentions and replies</string>
    <string name="moderate_recent">Moderate messages?</string>
</resources>

M src/main/java/eu/siacs/conversations/ui/ConversationFragment.java => src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +9 -2
@@ 1460,8 1460,15 @@ public class ConversationFragment extends XmppFragment
    }

    protected void setupEmojiSearch() {
        if (emojiSearch == null && activity != null && activity.xmppConnectionService != null) {
            emojiSearch = activity.xmppConnectionService.emojiSearch();
        if (activity != null && activity.xmppConnectionService != null) {
            if (!activity.xmppConnectionService.getBooleanPreference("message_autocomplete", R.bool.message_autocomplete)) {
                emojiSearch = null;
                if (emojiSearchBinding != null) emojiSearchBinding.emoji.setAdapter(null);
                return;
            }
            if (emojiSearch == null) {
                emojiSearch = activity.xmppConnectionService.emojiSearch();
            }
        }
        if (emojiSearch == null || emojiSearchBinding == null) return;


M src/main/res/values/defaults.xml => src/main/res/values/defaults.xml +1 -0
@@ 47,6 47,7 @@
    <bool name="prevent_screenshots">false</bool>
    <bool name="dialler_integration_incoming">true</bool>
    <bool name="follow_thread_in_channel">false</bool>
    <bool name="message_autocomplete">true</bool>
    <string name="default_push_server">up.conversations.im</string>
    <string name="default_push_account">none</string>
</resources>

M src/main/res/xml/preferences.xml => src/main/res/xml/preferences.xml +5 -0
@@ 380,6 380,11 @@
                    android:key="scroll_to_bottom"
                    android:summary="@string/pref_scroll_to_bottom_summary"
                    android:title="@string/pref_scroll_to_bottom" />
                <CheckBoxPreference
                    android:defaultValue="@bool/message_autocomplete"
                    android:key="message_autocomplete"
                    android:summary="@string/pref_message_autocomplete_summary"
                    android:title="@string/pref_message_autocomplete" />
            </PreferenceCategory>
            <PreferenceCategory android:key="expert_media" android:title="Media">
                <Preference