Small layout improvements

This commit is contained in:
Milos Kozak 2020-01-13 20:18:31 +01:00
parent 23de3b0a3b
commit dec6dcf63d
2 changed files with 17 additions and 22 deletions

View file

@ -1045,8 +1045,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (deltaShortView != null) if (deltaShortView != null)
deltaShortView.setText(Profile.toSignedUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units)); deltaShortView.setText(Profile.toSignedUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units));
if (avgdeltaView != null) if (avgdeltaView != null)
avgdeltaView.setText("øΔ15m: " + Profile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta * Constants.MGDL_TO_MMOLL, units) + avgdeltaView.setText("øΔ15m: " + Profile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta * Constants.MGDL_TO_MMOLL, units) + "\n" +
" øΔ40m: " + Profile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta * Constants.MGDL_TO_MMOLL, units)); "øΔ40m: " + Profile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta * Constants.MGDL_TO_MMOLL, units));
} else { } else {
if (deltaView != null) if (deltaView != null)
deltaView.setText("Δ " + MainApp.gs(R.string.notavailable)); deltaView.setText("Δ " + MainApp.gs(R.string.notavailable));
@ -1153,28 +1153,28 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (activeTemp != null) { if (activeTemp != null) {
basalText = "T: " + activeTemp.toStringVeryShort(); basalText = "T: " + activeTemp.toStringVeryShort();
} else { } else {
basalText = MainApp.gs(R.string.pump_basebasalrate,profile.getBasal()); basalText = MainApp.gs(R.string.pump_basebasalrate, profile.getBasal());
} }
baseBasalView.setOnClickListener(v -> {
String fullText = MainApp.gs(R.string.pump_basebasalrate_label) + ": " + MainApp.gs(R.string.pump_basebasalrate,profile.getBasal()) + "\n";
if (activeTemp != null) {
fullText += MainApp.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull();
}
OKDialog.show(getActivity(), MainApp.gs(R.string.basal), fullText);
});
} else { } else {
if (activeTemp != null) { if (activeTemp != null) {
basalText = activeTemp.toStringFull(); basalText = activeTemp.toStringFull();
} else { } else {
basalText = MainApp.gs(R.string.pump_basebasalrate,profile.getBasal()); basalText = MainApp.gs(R.string.pump_basebasalrate, profile.getBasal());
} }
} }
baseBasalView.setText(basalText); baseBasalView.setText(basalText);
baseBasalView.setOnClickListener(v -> {
String fullText = MainApp.gs(R.string.pump_basebasalrate_label) + ": " + MainApp.gs(R.string.pump_basebasalrate, profile.getBasal()) + "\n";
if (activeTemp != null) {
fullText += MainApp.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull();
}
OKDialog.show(getActivity(), MainApp.gs(R.string.basal), fullText);
});
if (activeTemp != null) { if (activeTemp != null) {
baseBasalView.setTextColor(MainApp.gc(R.color.basal)); baseBasalView.setTextColor(MainApp.gc(R.color.basal));
} else { } else {
baseBasalView.setTextColor(MainApp.gc(R.color.defaulttextcolor)); baseBasalView.setTextColor(MainApp.gc(R.color.defaulttextcolor));
} }
@ -1191,9 +1191,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
} }
extendedBolusView.setText(extendedBolusText); extendedBolusView.setText(extendedBolusText);
if (Config.NSCLIENT) { extendedBolusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.extended_bolus), extendedBolus.toString()));
extendedBolusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.extended_bolus), extendedBolus.toString()));
}
if (extendedBolusText.equals("")) if (extendedBolusText.equals(""))
extendedBolusView.setVisibility(Config.NSCLIENT ? View.INVISIBLE : View.GONE); extendedBolusView.setVisibility(Config.NSCLIENT ? View.INVISIBLE : View.GONE);
else else

View file

@ -150,22 +150,20 @@
<TextView <TextView
android:id="@+id/overview_timeago" android:id="@+id/overview_timeago"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="-2dp" android:layout_marginTop="-2dp"
android:paddingStart="2dp" android:paddingStart="2dp"
android:layout_weight="0.5"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
android:id="@+id/overview_delta" android:id="@+id/overview_delta"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="-2dp" android:layout_marginTop="-2dp"
android:paddingStart="2dp" android:paddingStart="2dp"
android:layout_weight="0.5"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -173,8 +171,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="0.5" android:textSize="14sp"/>
android:textSize="12sp"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>