fix landscape mode

This commit is contained in:
Milos Kozak 2017-06-20 19:56:25 +02:00
parent 745f9270ee
commit a3757877a3
2 changed files with 360 additions and 385 deletions

View file

@ -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);

View file

@ -5,14 +5,9 @@
android:layout_height="match_parent"
tools:context="info.nightscout.androidaps.plugins.Overview.OverviewFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/overview_buttons">
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
@ -286,38 +281,18 @@
android:layout_marginBottom="-5dp"
android:layout_marginTop="-9dp"
app:buttonTint="@color/deviations" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph"
android:layout_width="wrap_content"
android:layout_height="160dip"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
<TextView
android:id="@+id/overview_updating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:text="@string/updating"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/updating"
android:textStyle="bold" />
</RelativeLayout>
android:layout_height="160dip" />
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_iobgraph"
@ -423,5 +398,4 @@
</LinearLayout>
</ScrollView>
</RelativeLayout>
</FrameLayout>