From f2d7b355a8eb908410bc0aef59a6dd7b644c7ce3 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 12 Feb 2018 22:12:11 +0100 Subject: [PATCH] Make all table entries at least two lines high --- .../openscale/gui/fragments/TableFragment.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/android_app/app/src/main/java/com/health/openscale/gui/fragments/TableFragment.java b/android_app/app/src/main/java/com/health/openscale/gui/fragments/TableFragment.java index 630a9797..455b40be 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/fragments/TableFragment.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/fragments/TableFragment.java @@ -512,10 +512,14 @@ public class TableFragment extends Fragment implements FragmentUpdateListener { for (int i = 0; i < visibleMeasurements.size(); ++i) { TextView column = new TextView(getContext()); - column.setLayoutParams(new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1)); - column.getLayoutParams().width = 0; - column.setGravity(Gravity.CENTER); + LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.WRAP_CONTENT, + LinearLayout.LayoutParams.WRAP_CONTENT, + 1); + layoutParams.width = 0; + column.setLayoutParams(layoutParams); + column.setMinLines(2); + column.setGravity(Gravity.CENTER_HORIZONTAL); if (isSmallScreen) { column.setTextSize(COMPLEX_UNIT_DIP, 9);