Added expert setting for direct search

This commit is contained in:
Daniel Gultsch 2018-06-10 19:40:55 +02:00
parent fcfb695e7a
commit 10cee98913
4 changed files with 17 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import android.app.PendingIntent;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.databinding.DataBindingUtil; import android.databinding.DataBindingUtil;
import android.net.Uri; import android.net.Uri;
@ -283,7 +284,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
mConferenceAdapter = new ListItemAdapter(this, conferences); mConferenceAdapter = new ListItemAdapter(this, conferences);
mContactsAdapter = new ListItemAdapter(this, contacts); mContactsAdapter = new ListItemAdapter(this, contacts);
mContactsAdapter.setOnTagClickedListener(this.mOnTagClickedListener); mContactsAdapter.setOnTagClickedListener(this.mOnTagClickedListener);
this.mHideOfflineContacts = getPreferences().getBoolean("hide_offline", false);
final SharedPreferences preferences = getPreferences();
this.mHideOfflineContacts = preferences.getBoolean("hide_offline", false);
final boolean startSearching = preferences.getBoolean("start_searching",getResources().getBoolean(R.bool.start_searching));
final Intent intent; final Intent intent;
if (savedInstanceState == null) { if (savedInstanceState == null) {
@ -299,6 +305,8 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
if (isViewIntent(intent)) { if (isViewIntent(intent)) {
pendingViewIntent.push(intent); pendingViewIntent.push(intent);
setIntent(createLauncherIntent(this)); setIntent(createLauncherIntent(this));
} else if (startSearching && mInitialSearchValue.peek() == null) {
mInitialSearchValue.push("");
} }
} }

View file

@ -44,4 +44,5 @@
<string name="omemo_setting_default">default_on</string> <string name="omemo_setting_default">default_on</string>
<string name="default_font_size">small</string> <string name="default_font_size">small</string>
<bool name="use_share_location_plugin">false</bool> <bool name="use_share_location_plugin">false</bool>
<bool name="start_searching">false</bool>
</resources> </resources>

View file

@ -713,4 +713,6 @@
<string name="copy_link">Copy web address</string> <string name="copy_link">Copy web address</string>
<string name="copy_jabber_id">Copy Jabber ID</string> <string name="copy_jabber_id">Copy Jabber ID</string>
<string name="p1_s3_filetransfer">HTTP File Sharing for S3</string> <string name="p1_s3_filetransfer">HTTP File Sharing for S3</string>
<string name="pref_start_search">Direct Search</string>
<string name="pref_start_search_summary">At Start Conversation screen open keyboard and place cursor in search field</string>
</resources> </resources>

View file

@ -268,6 +268,11 @@
android:title="@string/pref_show_connection_options"/> android:title="@string/pref_show_connection_options"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/pref_input_options"> <PreferenceCategory android:title="@string/pref_input_options">
<CheckBoxPreference
android:defaultValue="@bool/start_searching"
android:key="start_searching"
android:summary="@string/pref_start_search_summary"
android:title="@string/pref_start_search"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="@bool/enter_is_send" android:defaultValue="@bool/enter_is_send"
android:key="enter_is_send" android:key="enter_is_send"