From 8dd714b390d7be8c485faeb1c859c626033a01c5 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sat, 15 Jul 2017 18:57:22 +0200 Subject: [PATCH] UI crimes --- .../androidaps/plugins/PumpCombo/ComboFragment.java | 12 +++++++++--- app/src/main/res/layout/combopump_fragment.xml | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java index 58367abc37..32b034c4a1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java @@ -34,14 +34,14 @@ public class ComboFragment extends Fragment { return comboPlugin; } - private EditText statusText; + private TextView statusText; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.combopump_fragment, container, false); - statusText = (EditText) view.findViewById(R.id.comboStatusEditText); + statusText = (TextView) view.findViewById(R.id.comboStatusEditText); updateGUI(); return view; @@ -64,6 +64,7 @@ public class ComboFragment extends Fragment { updateGUI(); } + // TODO *very* quick hack public void updateGUI() { Activity activity = getActivity(); if (activity != null) @@ -77,7 +78,12 @@ public class ComboFragment extends Fragment { sb.append(getPlugin().statusSummary); if (getPlugin().pumpState != null) { sb.append("\n\n"); - sb.append(getPlugin().pumpState.toString().replaceAll(",", "\n")); + sb.append(getPlugin().pumpState.toString() + // i know ... i need to take a break already + .replaceAll(", ", "\n") + .replaceAll("PumpState\\{", "\n") + .replaceAll("\\}", "\n") + ); } statusText.setText(sb.toString()); } diff --git a/app/src/main/res/layout/combopump_fragment.xml b/app/src/main/res/layout/combopump_fragment.xml index cb3662d56a..eec7a650a5 100644 --- a/app/src/main/res/layout/combopump_fragment.xml +++ b/app/src/main/res/layout/combopump_fragment.xml @@ -21,8 +21,8 @@ android:id="@+id/comboStatusEditText" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_gravity="center" android:ems="10" - android:textAlignment="center" - android:layout_gravity="center_horizontal"/> + android:padding="10dp" />