From f32064aa8272c95d8122d9d12415720a672efe5d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 26 Aug 2016 16:05:38 +0200 Subject: some multi-window optimizations. set min width to 300 --- src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java | 4 ++++ src/main/java/de/pixart/messenger/ui/WelcomeActivity.java | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/main/java/de') 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); -- cgit v1.2.3