aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/AndroidManifest.xml8
-rw-r--r--src/main/java/eu/siacs/conversations/ui/MagicCreateActivity.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java4
-rw-r--r--src/main/res/values-sw600dp/defaults.xml1
-rw-r--r--src/main/res/values-w300dp/dimens.xml3
-rw-r--r--src/main/res/values/defaults.xml1
6 files changed, 17 insertions, 4 deletions
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index abc4b89d..606b6daa 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -40,6 +40,8 @@
android:name=".ui.ConversationActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
+ android:minWidth="300dp"
+ android:minHeight="300dp"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -91,13 +93,11 @@
<activity
android:name=".ui.WelcomeActivity"
android:label="@string/app_name"
- android:launchMode="singleTask"
- android:screenOrientation="portrait" />
+ android:launchMode="singleTask"/>
<activity
android:name=".ui.MagicCreateActivity"
android:label="@string/create_account"
- android:launchMode="singleTask"
- android:screenOrientation="portrait" />
+ android:launchMode="singleTask"/>
<activity
android:name=".ui.SetPresenceActivity"
android:configChanges="orientation|screenSize"
diff --git a/src/main/java/eu/siacs/conversations/ui/MagicCreateActivity.java b/src/main/java/eu/siacs/conversations/ui/MagicCreateActivity.java
index 1b16e565..f0c72295 100644
--- a/src/main/java/eu/siacs/conversations/ui/MagicCreateActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/MagicCreateActivity.java
@@ -1,6 +1,7 @@
package eu.siacs.conversations.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/eu/siacs/conversations/ui/WelcomeActivity.java b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java
index 78f0f609..3c837b94 100644
--- a/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java
@@ -2,6 +2,7 @@ package eu.siacs.conversations.ui;
import android.app.Activity;
import android.content.Intent;
+import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@@ -12,6 +13,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);
final Button createAccount = (Button) findViewById(R.id.create_account);
diff --git a/src/main/res/values-sw600dp/defaults.xml b/src/main/res/values-sw600dp/defaults.xml
index e23a93de..b22a4ca8 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 00000000..28341a39
--- /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 be795ed4..7d613ab5 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