From 7113e21a433b04d82a161ea36625d3512a86f18a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 12 May 2016 18:47:41 +0200 Subject: use 'phone' or 'tablet' as default resource --- .../java/eu/siacs/conversations/services/XmppConnectionService.java | 2 +- src/main/res/values-sw600dp/defaults.xml | 4 ++++ src/main/res/values/defaults.xml | 4 ++++ src/main/res/xml/preferences.xml | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/main/res/values-sw600dp/defaults.xml create mode 100644 src/main/res/values/defaults.xml diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 4a7a8d67..7301c7aa 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -851,7 +851,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa public XmppConnection createConnection(final Account account) { final SharedPreferences sharedPref = getPreferences(); - account.setResource(sharedPref.getString("resource", "mobile") + account.setResource(sharedPref.getString("resource", getString(R.string.default_resource)) .toLowerCase(Locale.getDefault())); final XmppConnection connection = new XmppConnection(account, this); connection.setOnMessagePacketReceivedListener(this.mMessageParser); diff --git a/src/main/res/values-sw600dp/defaults.xml b/src/main/res/values-sw600dp/defaults.xml new file mode 100644 index 00000000..e23a93de --- /dev/null +++ b/src/main/res/values-sw600dp/defaults.xml @@ -0,0 +1,4 @@ + + + Tablet + \ No newline at end of file diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml new file mode 100644 index 00000000..be795ed4 --- /dev/null +++ b/src/main/res/values/defaults.xml @@ -0,0 +1,4 @@ + + + Phone + \ No newline at end of file diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index 63dc71db..80980417 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -9,7 +9,7 @@ android:title="@string/pref_grant_presence_updates"/>