diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-08-26 16:05:38 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-08-26 22:47:45 +0200 |
commit | f32064aa8272c95d8122d9d12415720a672efe5d (patch) | |
tree | 8e1c96501faff76499fd53bb8d9da6a9c41a0781 | |
parent | 634f461c847d5103a122b5009fe924e652e95495 (diff) |
some multi-window optimizations. set min width to 300
-rw-r--r-- | src/main/AndroidManifest.xml | 8 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/WelcomeActivity.java | 4 | ||||
-rw-r--r-- | src/main/res/values-sw600dp/defaults.xml | 1 | ||||
-rw-r--r-- | src/main/res/values-w300dp/dimens.xml | 3 | ||||
-rw-r--r-- | src/main/res/values/defaults.xml | 1 |
6 files changed, 17 insertions, 4 deletions
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 3b2d3174f..1bca1970c 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -68,6 +68,8 @@ android:name="de.pixart.messenger.ui.ConversationActivity" android:label="@string/app_name" android:launchMode="singleTask" + android:minWidth="300dp" + android:minHeight="300dp" android:windowSoftInputMode="stateHidden"> </activity> <activity @@ -110,13 +112,11 @@ <activity android:name="de.pixart.messenger.ui.WelcomeActivity" android:label="@string/app_name" - android:launchMode="singleTask" - android:screenOrientation="portrait"/> + android:launchMode="singleTask"/> <activity android:name="de.pixart.messenger.ui.MagicCreateActivity" android:label="@string/create_account" - android:launchMode="singleTask" - android:screenOrientation="portrait"/> + android:launchMode="singleTask"/> <activity android:name="de.pixart.messenger.ui.SetPresenceActivity" android:configChanges="orientation|screenSize" diff --git a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java index 6927c9732..c83318160 100644 --- a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java +++ b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java @@ -1,6 +1,7 @@ package de.pixart.messenger.ui; import android.content.Intent; +import android.content.pm.ActivityInfo; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; @@ -39,6 +40,9 @@ public class MagicCreateActivity extends XmppActivity implements TextWatcher { @Override protected void onCreate(final Bundle savedInstanceState) { + if (getResources().getBoolean(R.bool.portrait_only)) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + } super.onCreate(savedInstanceState); setContentView(R.layout.magic_create); mFullJidDisplay = (TextView) findViewById(R.id.full_jid); diff --git a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java index 0442492d7..1297f0fd2 100644 --- a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java +++ b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java @@ -6,6 +6,7 @@ import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; +import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.database.sqlite.SQLiteDatabase; @@ -45,6 +46,9 @@ public class WelcomeActivity extends Activity { @Override protected void onCreate(final Bundle savedInstanceState) { + if (getResources().getBoolean(R.bool.portrait_only)) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + } super.onCreate(savedInstanceState); setContentView(R.layout.welcome); diff --git a/src/main/res/values-sw600dp/defaults.xml b/src/main/res/values-sw600dp/defaults.xml index e23a93de3..b22a4ca8a 100644 --- a/src/main/res/values-sw600dp/defaults.xml +++ b/src/main/res/values-sw600dp/defaults.xml @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <string name="default_resource">Tablet</string> + <bool name="portrait_only">false</bool> </resources>
\ No newline at end of file diff --git a/src/main/res/values-w300dp/dimens.xml b/src/main/res/values-w300dp/dimens.xml new file mode 100644 index 000000000..28341a395 --- /dev/null +++ b/src/main/res/values-w300dp/dimens.xml @@ -0,0 +1,3 @@ +<resources> + <dimen name="conversations_overview_width">276dp</dimen> +</resources> diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml index be795ed40..7d613ab5e 100644 --- a/src/main/res/values/defaults.xml +++ b/src/main/res/values/defaults.xml @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <string name="default_resource">Phone</string> + <bool name="portrait_only">true</bool> </resources>
\ No newline at end of file |