aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java9
-rw-r--r--src/main/res/values/defaults.xml1
-rw-r--r--src/main/res/values/strings.xml2
-rw-r--r--src/main/res/xml/preferences.xml5
4 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index 25744bdad..358c9dff7 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -7,6 +7,7 @@ import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.databinding.DataBindingUtil;
import android.net.Uri;
@@ -285,7 +286,11 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
mConferenceAdapter = new ListItemAdapter(this, conferences);
mContactsAdapter = new ListItemAdapter(this, contacts);
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;
if (savedInstanceState == null) {
@@ -301,6 +306,8 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
if (isViewIntent(intent)) {
pendingViewIntent.push(intent);
setIntent(createLauncherIntent(this));
+ } else if (startSearching && mInitialSearchValue.peek() == null) {
+ mInitialSearchValue.push("");
}
}
diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml
index 59754dee2..91eb210d4 100644
--- a/src/main/res/values/defaults.xml
+++ b/src/main/res/values/defaults.xml
@@ -106,6 +106,7 @@
<string name="omemo_setting_default">default_off</string>
<string name="theme">light</string>
<string name="default_font_size">small</string>
+ <bool name="start_searching">false</bool>
<string-array name="domains">
<item>pix-art.de</item>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 8d842af79..758f077fd 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -793,4 +793,6 @@
<string name="show_privacy">Privacy Policy</string>
<string name="show_termsofuse">Terms of Use</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>
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index f3fa6a5ed..49de3cfc0 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -395,6 +395,11 @@
</PreferenceCategory>
<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
android:defaultValue="@bool/enter_is_send"
android:key="enter_is_send"
android:summary="@string/pref_enter_is_send_summary"