From 418a7f7094181889b98cc939990edd319de3faca Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Thu, 30 Nov 2017 09:45:18 +0200 Subject: [PATCH 1/7] ProfileSwitch depending on ScreenSize Text size in ProfileSwitch events depends on screen resolution --- .../PointsWithLabelGraphSeries.java | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java index 970aaa8385..0a1219b192 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -30,7 +30,10 @@ import android.graphics.Path; import android.graphics.Point; import android.graphics.Rect; import android.graphics.Typeface; - +import android.util.TypedValue; +// Added by Rumen for scalable text +import android.content.Context; +import info.nightscout.androidaps.MainApp; import com.jjoe64.graphview.GraphView; import com.jjoe64.graphview.series.BaseSeries; @@ -69,7 +72,9 @@ public class PointsWithLabelGraphSeries e OPENAPSOFFLINE, EXERCISE, GENERAL, - GENERALWITHDURATION + GENERALWITHDURATION, + BG, + PREDICTION } /** @@ -191,9 +196,19 @@ public class PointsWithLabelGraphSeries e // draw data point if (!overdraw) { - if (value.getShape() == Shape.POINT) { + if (value.getShape() == Shape.BG) { + mPaint.setStyle(Paint.Style.FILL); mPaint.setStrokeWidth(0); canvas.drawCircle(endX, endY, value.getSize(), mPaint); + } else if (value.getShape() == Shape.PREDICTION) { + mPaint.setColor(value.getColor()); + mPaint.setStyle(Paint.Style.FILL); + mPaint.setStrokeWidth(0); + canvas.drawCircle(endX, endY, value.getSize(), mPaint); + mPaint.setColor(value.getSecondColor()); + mPaint.setStyle(Paint.Style.FILL); + mPaint.setStrokeWidth(0); + canvas.drawCircle(endX, endY, value.getSize() / 3, mPaint); } else if (value.getShape() == Shape.RECTANGLE) { canvas.drawRect(endX-value.getSize(), endY-value.getSize(), endX+value.getSize(), endY+value.getSize(), mPaint); } else if (value.getShape() == Shape.TRIANGLE) { @@ -228,7 +243,13 @@ public class PointsWithLabelGraphSeries e } else if (value.getShape() == Shape.PROFILE) { mPaint.setStrokeWidth(0); if (value.getLabel() != null) { - mPaint.setTextSize((int) (value.getSize() * 3)); + //mPaint.setTextSize((int) (value.getSize() * 6)); + int spSize = 14; + //your sp size + // Convert the sp to pixels + Context context = MainApp.instance().getApplicationContext(); + float scaledTextSize = spSize * context.getResources().getDisplayMetrics().scaledDensity; + mPaint.setTextSize(scaledTextSize); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)); Rect bounds = new Rect(); mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds); @@ -244,7 +265,6 @@ public class PointsWithLabelGraphSeries e } else if (value.getShape() == Shape.MBG) { mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(5); - float w = mPaint.getStrokeWidth(); canvas.drawCircle(endX, endY, value.getSize(), mPaint); } else if (value.getShape() == Shape.BGCHECK) { mPaint.setStyle(Paint.Style.FILL_AND_STROKE); From 24b932660219af79ca429b56fb7f142ec09661a4 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Thu, 30 Nov 2017 09:57:16 +0200 Subject: [PATCH 2/7] Update PointsWithLabelGraphSeries.java --- .../graphExtensions/PointsWithLabelGraphSeries.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java index 0a1219b192..0ee61d33be 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -200,16 +200,7 @@ public class PointsWithLabelGraphSeries e mPaint.setStyle(Paint.Style.FILL); mPaint.setStrokeWidth(0); canvas.drawCircle(endX, endY, value.getSize(), mPaint); - } else if (value.getShape() == Shape.PREDICTION) { - mPaint.setColor(value.getColor()); - mPaint.setStyle(Paint.Style.FILL); - mPaint.setStrokeWidth(0); - canvas.drawCircle(endX, endY, value.getSize(), mPaint); - mPaint.setColor(value.getSecondColor()); - mPaint.setStyle(Paint.Style.FILL); - mPaint.setStrokeWidth(0); - canvas.drawCircle(endX, endY, value.getSize() / 3, mPaint); - } else if (value.getShape() == Shape.RECTANGLE) { + } else if (value.getShape() == Shape.RECTANGLE) { canvas.drawRect(endX-value.getSize(), endY-value.getSize(), endX+value.getSize(), endY+value.getSize(), mPaint); } else if (value.getShape() == Shape.TRIANGLE) { mPaint.setStrokeWidth(0); From d683ea2f0c58ba4502fe995f02b08b39fa728bb3 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Thu, 30 Nov 2017 11:28:26 +0200 Subject: [PATCH 3/7] All labes scaled COB is not here --- .../PointsWithLabelGraphSeries.java | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java index 0ee61d33be..a5fe5b7700 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -47,6 +47,11 @@ import java.util.Iterator; * @author jjoe64 */ public class PointsWithLabelGraphSeries extends BaseSeries { + // Default spSize + int spSize = 12; + // Convert the sp to pixels + Context context = MainApp.instance().getApplicationContext(); + float scaledTextSize = spSize * context.getResources().getDisplayMetrics().scaledDensity; /** * choose a predefined shape to render for * each data point. @@ -72,9 +77,7 @@ public class PointsWithLabelGraphSeries e OPENAPSOFFLINE, EXERCISE, GENERAL, - GENERALWITHDURATION, - BG, - PREDICTION + GENERALWITHDURATION } /** @@ -196,11 +199,10 @@ public class PointsWithLabelGraphSeries e // draw data point if (!overdraw) { - if (value.getShape() == Shape.BG) { - mPaint.setStyle(Paint.Style.FILL); + if (value.getShape() == Shape.POINT) { mPaint.setStrokeWidth(0); canvas.drawCircle(endX, endY, value.getSize(), mPaint); - } else if (value.getShape() == Shape.RECTANGLE) { + } else if (value.getShape() == Shape.RECTANGLE) { canvas.drawRect(endX-value.getSize(), endY-value.getSize(), endX+value.getSize(), endY+value.getSize(), mPaint); } else if (value.getShape() == Shape.TRIANGLE) { mPaint.setStrokeWidth(0); @@ -226,7 +228,7 @@ public class PointsWithLabelGraphSeries e Rect bounds = new Rect((int)endX, (int)endY + 3, (int) (xpluslength), (int) endY + 8); mPaint.setStyle(Paint.Style.FILL_AND_STROKE); canvas.drawRect(bounds, mPaint); - mPaint.setTextSize((int) (value.getSize() * 2.5)); + mPaint.setTextSize((int) (scaledTextSize * 2.5)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)); mPaint.setFakeBoldText(true); canvas.drawText(value.getLabel(), endX, endY, mPaint); @@ -234,12 +236,7 @@ public class PointsWithLabelGraphSeries e } else if (value.getShape() == Shape.PROFILE) { mPaint.setStrokeWidth(0); if (value.getLabel() != null) { - //mPaint.setTextSize((int) (value.getSize() * 6)); - int spSize = 14; - //your sp size - // Convert the sp to pixels - Context context = MainApp.instance().getApplicationContext(); - float scaledTextSize = spSize * context.getResources().getDisplayMetrics().scaledDensity; + mPaint.setTextSize((int) (value.getSize() * 3)); mPaint.setTextSize(scaledTextSize); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)); Rect bounds = new Rect(); @@ -256,6 +253,7 @@ public class PointsWithLabelGraphSeries e } else if (value.getShape() == Shape.MBG) { mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(5); + float w = mPaint.getStrokeWidth(); canvas.drawCircle(endX, endY, value.getSize(), mPaint); } else if (value.getShape() == Shape.BGCHECK) { mPaint.setStyle(Paint.Style.FILL_AND_STROKE); @@ -282,7 +280,7 @@ public class PointsWithLabelGraphSeries e mPaint.setStrokeWidth(0); if (value.getLabel() != null) { mPaint.setStrokeWidth(0); - mPaint.setTextSize((int) (value.getSize() * 3)); + mPaint.setTextSize((int) (scaledTextSize * 3)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)); Rect bounds = new Rect(); mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds); @@ -297,7 +295,7 @@ public class PointsWithLabelGraphSeries e mPaint.setStrokeWidth(0); if (value.getLabel() != null) { mPaint.setStrokeWidth(0); - mPaint.setTextSize((int) (value.getSize() * 3)); + mPaint.setTextSize(scaledTextSize); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)); Rect bounds = new Rect(); mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds); @@ -312,7 +310,7 @@ public class PointsWithLabelGraphSeries e mPaint.setStrokeWidth(0); if (value.getLabel() != null) { mPaint.setStrokeWidth(0); - mPaint.setTextSize((int) (value.getSize() * 3)); + mPaint.setTextSize(scaledTextSize * 3); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)); Rect bounds = new Rect(); mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds); @@ -366,7 +364,7 @@ public class PointsWithLabelGraphSeries e float py = endY + value.getSize(); canvas.save(); canvas.rotate(-45, px, py); - mPaint.setTextSize((int) (value.getSize() * 2.5)); + mPaint.setTextSize((float) (scaledTextSize*0.8)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)); mPaint.setFakeBoldText(true); mPaint.setTextAlign(Paint.Align.RIGHT); @@ -378,11 +376,11 @@ public class PointsWithLabelGraphSeries e float py = endY - value.getSize(); canvas.save(); canvas.rotate(-45, px, py); - mPaint.setTextSize((int) (value.getSize() * 2.5)); + mPaint.setTextSize((float) (scaledTextSize*0.8)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)); mPaint.setFakeBoldText(true); canvas.drawText(value.getLabel(), px + value.getSize(), py, mPaint); canvas.restore(); } } -} +} From ecbac7ea96603d8951f7d3621d6c53afebd15c61 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Fri, 1 Dec 2017 10:30:18 +0200 Subject: [PATCH 4/7] Make ProfileSwitch text 20% larger --- .../Overview/graphExtensions/PointsWithLabelGraphSeries.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java index a5fe5b7700..98bdaf83ee 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -236,8 +236,8 @@ public class PointsWithLabelGraphSeries e } else if (value.getShape() == Shape.PROFILE) { mPaint.setStrokeWidth(0); if (value.getLabel() != null) { - mPaint.setTextSize((int) (value.getSize() * 3)); - mPaint.setTextSize(scaledTextSize); + //mPaint.setTextSize((int) (value.getSize() * 3)); + mPaint.setTextSize((float) (scaledTextSize*1.2)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)); Rect bounds = new Rect(); mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds); From 7958dc9dcea9408d9cd82fe068dfe0a358d412f3 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 3 Dec 2017 13:55:54 +0100 Subject: [PATCH 5/7] jelly overview --- .../plugins/Overview/graphData/GraphData.java | 4 +-- .../PointsWithLabelGraphSeries.java | 36 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java index 9171cd81e7..8bead45e85 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java @@ -194,7 +194,7 @@ public class GraphData { basalsLineSeries = new LineGraphSeries<>(basalLine); Paint paint = new Paint(); paint.setStyle(Paint.Style.STROKE); - paint.setStrokeWidth(2); + paint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity*2); paint.setPathEffect(new DashPathEffect(new float[]{2, 4}, 0)); paint.setColor(MainApp.sResources.getColor(R.color.basal)); basalsLineSeries.setCustomPaint(paint); @@ -204,7 +204,7 @@ public class GraphData { absoluteBasalsLineSeries = new LineGraphSeries<>(absoluteBasalLine); Paint absolutePaint = new Paint(); absolutePaint.setStyle(Paint.Style.STROKE); - absolutePaint.setStrokeWidth(4); + absolutePaint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity*2); absolutePaint.setColor(MainApp.sResources.getColor(R.color.basal)); absoluteBasalsLineSeries.setCustomPaint(absolutePaint); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java index 98bdaf83ee..f264a22382 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -52,6 +52,8 @@ public class PointsWithLabelGraphSeries e // Convert the sp to pixels Context context = MainApp.instance().getApplicationContext(); float scaledTextSize = spSize * context.getResources().getDisplayMetrics().scaledDensity; + float scaledPxSize = context.getResources().getDisplayMetrics().scaledDensity * 1.5f; + /** * choose a predefined shape to render for * each data point. @@ -201,22 +203,22 @@ public class PointsWithLabelGraphSeries e if (!overdraw) { if (value.getShape() == Shape.POINT) { mPaint.setStrokeWidth(0); - canvas.drawCircle(endX, endY, value.getSize(), mPaint); + canvas.drawCircle(endX, endY, scaledPxSize, mPaint); } else if (value.getShape() == Shape.RECTANGLE) { - canvas.drawRect(endX-value.getSize(), endY-value.getSize(), endX+value.getSize(), endY+value.getSize(), mPaint); + canvas.drawRect(endX-scaledPxSize, endY-scaledPxSize, endX+scaledPxSize, endY+scaledPxSize, mPaint); } else if (value.getShape() == Shape.TRIANGLE) { mPaint.setStrokeWidth(0); Point[] points = new Point[3]; - points[0] = new Point((int)endX, (int)(endY-value.getSize())); - points[1] = new Point((int)(endX+value.getSize()), (int)(endY+value.getSize()*0.67)); - points[2] = new Point((int)(endX-value.getSize()), (int)(endY+value.getSize()*0.67)); + points[0] = new Point((int)endX, (int)(endY-scaledPxSize)); + points[1] = new Point((int)(endX+scaledPxSize), (int)(endY+scaledPxSize*0.67)); + points[2] = new Point((int)(endX-scaledPxSize), (int)(endY+scaledPxSize*0.67)); drawArrows(points, canvas, mPaint); } else if (value.getShape() == Shape.BOLUS) { mPaint.setStrokeWidth(0); Point[] points = new Point[3]; - points[0] = new Point((int)endX, (int)(endY-value.getSize())); - points[1] = new Point((int)(endX+value.getSize()), (int)(endY+value.getSize()*0.67)); - points[2] = new Point((int)(endX-value.getSize()), (int)(endY+value.getSize()*0.67)); + points[0] = new Point((int)endX, (int)(endY-scaledPxSize)); + points[1] = new Point((int)(endX+scaledPxSize), (int)(endY+scaledPxSize*0.67)); + points[2] = new Point((int)(endX-scaledPxSize), (int)(endY+scaledPxSize*0.67)); mPaint.setStyle(Paint.Style.FILL_AND_STROKE); drawArrows(points, canvas, mPaint); if (value.getLabel() != null) { @@ -236,7 +238,7 @@ public class PointsWithLabelGraphSeries e } else if (value.getShape() == Shape.PROFILE) { mPaint.setStrokeWidth(0); if (value.getLabel() != null) { - //mPaint.setTextSize((int) (value.getSize() * 3)); + //mPaint.setTextSize((int) (scaledPxSize * 3)); mPaint.setTextSize((float) (scaledTextSize*1.2)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD)); Rect bounds = new Rect(); @@ -254,25 +256,25 @@ public class PointsWithLabelGraphSeries e mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(5); float w = mPaint.getStrokeWidth(); - canvas.drawCircle(endX, endY, value.getSize(), mPaint); + canvas.drawCircle(endX, endY, scaledPxSize, mPaint); } else if (value.getShape() == Shape.BGCHECK) { mPaint.setStyle(Paint.Style.FILL_AND_STROKE); mPaint.setStrokeWidth(0); - canvas.drawCircle(endX, endY, value.getSize(), mPaint); + canvas.drawCircle(endX, endY, scaledPxSize, mPaint); if (value.getLabel() != null) { drawLabel45(endX, endY, value, canvas); } } else if (value.getShape() == Shape.ANNOUNCEMENT) { mPaint.setStyle(Paint.Style.FILL_AND_STROKE); mPaint.setStrokeWidth(0); - canvas.drawCircle(endX, endY, value.getSize(), mPaint); + canvas.drawCircle(endX, endY, scaledPxSize, mPaint); if (value.getLabel() != null) { drawLabel45(endX, endY, value, canvas); } } else if (value.getShape() == Shape.GENERAL) { mPaint.setStyle(Paint.Style.FILL_AND_STROKE); mPaint.setStrokeWidth(0); - canvas.drawCircle(endX, endY, value.getSize(), mPaint); + canvas.drawCircle(endX, endY, scaledPxSize, mPaint); if (value.getLabel() != null) { drawLabel45(endX, endY, value, canvas); } @@ -361,25 +363,25 @@ public class PointsWithLabelGraphSeries e void drawLabel45(float endX, float endY, E value, Canvas canvas) { if (value.getLabel().startsWith("~")) { float px = endX; - float py = endY + value.getSize(); + float py = endY + scaledPxSize; canvas.save(); canvas.rotate(-45, px, py); mPaint.setTextSize((float) (scaledTextSize*0.8)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)); mPaint.setFakeBoldText(true); mPaint.setTextAlign(Paint.Align.RIGHT); - canvas.drawText(value.getLabel().substring(1), px - value.getSize(), py, mPaint); + canvas.drawText(value.getLabel().substring(1), px - scaledPxSize, py, mPaint); mPaint.setTextAlign(Paint.Align.LEFT); canvas.restore(); } else { float px = endX; - float py = endY - value.getSize(); + float py = endY - scaledPxSize; canvas.save(); canvas.rotate(-45, px, py); mPaint.setTextSize((float) (scaledTextSize*0.8)); mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)); mPaint.setFakeBoldText(true); - canvas.drawText(value.getLabel(), px + value.getSize(), py, mPaint); + canvas.drawText(value.getLabel(), px + scaledPxSize, py, mPaint); canvas.restore(); } } From 7777143b07f918a1416d3a3c9bbfd5c768b1636a Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 3 Dec 2017 17:30:20 +0100 Subject: [PATCH 6/7] scrollable overview on Jelly --- app/src/main/java/info/nightscout/androidaps/Constants.java | 2 +- .../androidaps/plugins/Overview/OverviewFragment.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/Constants.java b/app/src/main/java/info/nightscout/androidaps/Constants.java index 6765b15558..9022020828 100644 --- a/app/src/main/java/info/nightscout/androidaps/Constants.java +++ b/app/src/main/java/info/nightscout/androidaps/Constants.java @@ -54,7 +54,7 @@ public class Constants { //Screen: Threshold for width/height to go into small width/height layout public static final int SMALL_WIDTH = 320; - public static final int SMALL_HEIGHT = 320; + public static final int SMALL_HEIGHT = 480; //Autosens public static final double DEVIATION_TO_BE_EQUAL = 2.0; 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 f06baaaed6..cbca81cf0b 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 @@ -192,8 +192,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm); int screen_width = dm.widthPixels; int screen_height = dm.heightPixels; - smallWidth = screen_width < Constants.SMALL_WIDTH; - smallHeight = screen_height < Constants.SMALL_HEIGHT; + smallWidth = screen_width <= Constants.SMALL_WIDTH; + smallHeight = screen_height <= Constants.SMALL_HEIGHT; boolean landscape = screen_height < screen_width; View view; @@ -203,7 +203,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, } else if (Config.NSCLIENT || Config.G5UPLOADER) { view = inflater.inflate(R.layout.overview_fragment_nsclient, container, false); shorttextmode = true; - } else if (smallHeight || landscape) { + } else if (smallHeight) { view = inflater.inflate(R.layout.overview_fragment_smallheight, container, false); } else { view = inflater.inflate(R.layout.overview_fragment, container, false); From 53723411c46acc3a51e9415ffb7f0144d65f3ebf Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Mon, 4 Dec 2017 10:42:34 +0100 Subject: [PATCH 7/7] fix landscape overview --- .../androidaps/plugins/Overview/OverviewFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cbca81cf0b..8e3c2cb29e 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 @@ -203,7 +203,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, } else if (Config.NSCLIENT || Config.G5UPLOADER) { view = inflater.inflate(R.layout.overview_fragment_nsclient, container, false); shorttextmode = true; - } 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);