From 12621d50674c35657e3bae95624d043ba4f7c9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Sun, 23 Oct 2016 18:16:06 +0200 Subject: [PATCH] First attempts to make better layout for tablets (for big tablets - home page layout changed partially). --- .../urbanexplorer/MainActivity.java | 7 ++-- .../activity_main.xml} | 1 + .../activity_main.xml} | 33 ++++++++++--------- app/src/main/res/values-sw600dp/tech.xml | 4 +++ app/src/main/res/values-sw720dp/tech.xml | 4 +++ app/src/main/res/values/tech.xml | 4 +++ 6 files changed, 35 insertions(+), 18 deletions(-) rename app/src/main/res/{layout/activity_main_two_frag.xml => layout-sw600dp/activity_main.xml} (97%) rename app/src/main/res/{layout/activity_main_three_frag.xml => layout-sw720dp/activity_main.xml} (50%) create mode 100644 app/src/main/res/values-sw600dp/tech.xml create mode 100644 app/src/main/res/values-sw720dp/tech.xml create mode 100644 app/src/main/res/values/tech.xml diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index f3faf93..9dae7d1 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -123,8 +123,11 @@ public class MainActivity extends ActionBarActivity { boolean copySavedConfiguration = savedConfiguration = savedInstanceState != null && savedInstanceState.getBoolean(AppConstants.SAVED_CONFIG_KEY); - switchFragment(); - updateSwipeHandler(); + String deviceType = getResources().getString(R.string.device_type); + if ("Plain".equals(deviceType)) { + switchFragment(); + updateSwipeHandler(); + } if (!copySavedConfiguration && HelperUtils.checkForLocalicatonEnabled(this)) return; } diff --git a/app/src/main/res/layout/activity_main_two_frag.xml b/app/src/main/res/layout-sw600dp/activity_main.xml similarity index 97% rename from app/src/main/res/layout/activity_main_two_frag.xml rename to app/src/main/res/layout-sw600dp/activity_main.xml index 8b38205..a9d4684 100644 --- a/app/src/main/res/layout/activity_main_two_frag.xml +++ b/app/src/main/res/layout-sw600dp/activity_main.xml @@ -2,6 +2,7 @@ - + - + - + - + + + - - - + diff --git a/app/src/main/res/values-sw600dp/tech.xml b/app/src/main/res/values-sw600dp/tech.xml new file mode 100644 index 0000000..34a6baa --- /dev/null +++ b/app/src/main/res/values-sw600dp/tech.xml @@ -0,0 +1,4 @@ + + + 600 + \ No newline at end of file diff --git a/app/src/main/res/values-sw720dp/tech.xml b/app/src/main/res/values-sw720dp/tech.xml new file mode 100644 index 0000000..eb42eca --- /dev/null +++ b/app/src/main/res/values-sw720dp/tech.xml @@ -0,0 +1,4 @@ + + + 720 + \ No newline at end of file diff --git a/app/src/main/res/values/tech.xml b/app/src/main/res/values/tech.xml new file mode 100644 index 0000000..3f92b7e --- /dev/null +++ b/app/src/main/res/values/tech.xml @@ -0,0 +1,4 @@ + + + Plain + \ No newline at end of file