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,7 +1045,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (deltaShortView != null)
deltaShortView.setText(Profile.toSignedUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units));
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));
} else {
if (deltaView != null)
@ -1155,14 +1155,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} else {
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 {
if (activeTemp != null) {
basalText = activeTemp.toStringFull();
@ -1171,6 +1163,14 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
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) {
baseBasalView.setTextColor(MainApp.gc(R.color.basal));
} else {
@ -1191,9 +1191,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
extendedBolusView.setText(extendedBolusText);
if (Config.NSCLIENT) {
extendedBolusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.extended_bolus), extendedBolus.toString()));
}
if (extendedBolusText.equals(""))
extendedBolusView.setVisibility(Config.NSCLIENT ? View.INVISIBLE : View.GONE);
else

View file

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