From a3757877a3bf93db1be32a42804695c75b643195 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 20 Jun 2017 19:56:25 +0200 Subject: [PATCH 1/2] fix landscape mode --- .../plugins/Overview/OverviewFragment.java | 3 +- .../layout/overview_fragment_smallheight.xml | 742 +++++++++--------- 2 files changed, 360 insertions(+), 385 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 26feb54704..a8efff4eb4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -211,12 +211,13 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, int screen_height = dm.heightPixels; smallWidth = screen_width < Constants.SMALL_WIDTH; smallHeight = screen_height < Constants.SMALL_HEIGHT; + boolean landscape = screen_height < screen_width; View view; if (MainApp.sResources.getBoolean(R.bool.isTablet)) { view = inflater.inflate(R.layout.overview_fragment_tablet, container, false); - } else if (smallHeight) { + } else if (smallHeight || landscape) { view = inflater.inflate(R.layout.overview_fragment_smallheight, container, false); } else { view = inflater.inflate(R.layout.overview_fragment, container, false); diff --git a/app/src/main/res/layout/overview_fragment_smallheight.xml b/app/src/main/res/layout/overview_fragment_smallheight.xml index c22bcf5e70..0df556d110 100644 --- a/app/src/main/res/layout/overview_fragment_smallheight.xml +++ b/app/src/main/res/layout/overview_fragment_smallheight.xml @@ -5,423 +5,397 @@ android:layout_height="match_parent" tools:context="info.nightscout.androidaps.plugins.Overview.OverviewFragment"> - + android:layout_height="match_parent" > - + android:layout_height="wrap_content" + android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + android:gravity="center_horizontal" + android:orientation="horizontal"> - + - - - - - - - - - - - - - - - - - + - - - - + android:layout_gravity="top" + android:layout_marginTop="10dp" + android:gravity="top" + android:orientation="vertical"> - - - - - - - - + android:layout_weight="0.5" + android:textAppearance="?android:attr/textAppearanceMedium" /> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -