temptarget design
This commit is contained in:
parent
bb9c68fd4d
commit
2ae30fe9b4
6 changed files with 29 additions and 31 deletions
|
@ -1122,7 +1122,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
double lastLineBasal = 0;
|
||||
double lastBaseBasal = 0;
|
||||
double lastTempBasal = 0;
|
||||
for (long time = fromTime; time < now; time += 5 * 60 * 1000L) {
|
||||
for (long time = fromTime; time < now; time += 1 * 60 * 1000L) {
|
||||
TemporaryBasal tb = MainApp.getConfigBuilder().getTempBasal(time);
|
||||
double baseBasalValue = profile.getBasal(NSProfile.secondsFromMidnight(new Date(time)));
|
||||
double baseLineValue = baseBasalValue;
|
||||
|
|
|
@ -63,7 +63,7 @@ public class TreatmentsExtendedBolusesFragment extends Fragment {
|
|||
ExtendedBolus extendedBolus = extendedBolusList.getReversed(position);
|
||||
if (extendedBolus.isEndingEvent()) {
|
||||
holder.date.setText(DateUtil.dateAndTimeString(extendedBolus.date));
|
||||
holder.duration.setText(MainApp.sResources.getString(R.string.stopevent));
|
||||
holder.duration.setText(MainApp.sResources.getString(R.string.cancel));
|
||||
holder.insulin.setText("");
|
||||
holder.realDuration.setText("");
|
||||
holder.iob.setText("");
|
||||
|
|
|
@ -64,8 +64,8 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
public void onBindViewHolder(TempTargetsViewHolder holder, int position) {
|
||||
NSProfile profile = ConfigBuilderPlugin.getActiveProfile().getProfile();
|
||||
if (profile == null) return;
|
||||
TempTarget tempTarget = tempTargetList.get(position);
|
||||
if (tempTarget.durationInMinutes != 0) {
|
||||
TempTarget tempTarget = tempTargetList.getReversed(position);
|
||||
if (!tempTarget.isEndingEvent()) {
|
||||
holder.date.setText(DateUtil.dateAndTimeString(tempTarget.date) + " - " + DateUtil.timeString(tempTargetList.get(position).originalEnd()));
|
||||
holder.duration.setText(DecimalFormatter.to0Decimal(tempTarget.durationInMinutes) + " min");
|
||||
holder.low.setText(tempTarget.lowValueToUnitsToString(profile.getUnits()));
|
||||
|
@ -81,9 +81,9 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
holder.reasonColon.setText("");
|
||||
}
|
||||
if (tempTarget.isInProgress())
|
||||
holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorInProgress));
|
||||
holder.date.setTextColor(ContextCompat.getColor(MainApp.instance(), R.color.colorActive));
|
||||
else
|
||||
holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.cardColorBackground));
|
||||
holder.date.setTextColor(holder.reasonColon.getCurrentTextColor());
|
||||
holder.remove.setTag(tempTarget);
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,6 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
TextView reasonLabel;
|
||||
TextView reasonColon;
|
||||
TextView remove;
|
||||
LinearLayout dateLinearLayout;
|
||||
|
||||
TempTargetsViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
@ -122,7 +121,6 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
remove = (TextView) itemView.findViewById(R.id.temptargetrange_remove);
|
||||
remove.setOnClickListener(this);
|
||||
remove.setPaintFlags(remove.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
|
||||
dateLinearLayout = (LinearLayout) itemView.findViewById(R.id.temptargetrange_datelinearlayout);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -65,7 +65,7 @@ public class TreatmentsTemporaryBasalsFragment extends Fragment {
|
|||
TemporaryBasal tempBasal = tempBasalList.getReversed(position);
|
||||
if (tempBasal.isEndingEvent()) {
|
||||
holder.date.setText(DateUtil.dateAndTimeString(tempBasal.date));
|
||||
holder.duration.setText(MainApp.sResources.getString(R.string.stopevent));
|
||||
holder.duration.setText(MainApp.sResources.getString(R.string.cancel));
|
||||
holder.absolute.setText("");
|
||||
holder.percent.setText("");
|
||||
holder.realDuration.setText("");
|
||||
|
|
|
@ -5,10 +5,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
card_view:cardBackgroundColor="@color/cardColorBackground"
|
||||
card_view:cardCornerRadius="6dp"
|
||||
card_view:cardUseCompatPadding="true"
|
||||
card_view:contentPadding="6dp">
|
||||
card_view:cardBackgroundColor="?android:colorBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -16,7 +13,6 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/temptargetrange_datelinearlayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="true"
|
||||
|
@ -28,10 +24,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical|right"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="{fa-clock-o}"
|
||||
android:textColor="@color/cardItemLabel" />
|
||||
android:text="{fa-clock-o}" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/temptargetrange_date"
|
||||
|
@ -39,8 +34,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="1.1.2000 18:00"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/cardItemLabel" />
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/temptargetrange_low"
|
||||
|
@ -48,16 +42,14 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="80"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/cardItemLabel" />
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="5dp"
|
||||
android:text="-"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/cardItemLabel" />
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/temptargetrange_high"
|
||||
|
@ -65,8 +57,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="5dp"
|
||||
android:text="100"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/cardItemLabel" />
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/temptargetrange_duration"
|
||||
|
@ -74,8 +65,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="30 min"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/cardItemLabel" />
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -105,21 +95,32 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="10dp"
|
||||
android:text="Activity"
|
||||
android:layout_weight="1"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:text="@string/overview_quickwizard_item_remove_button"
|
||||
android:id="@+id/temptargetrange_remove"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/temptargetrange_remove"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/overview_quickwizard_item_remove_button"
|
||||
android:textAlignment="viewEnd"
|
||||
android:textColor="@android:color/holo_orange_light" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="2dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/listdelimiter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
|
|
@ -612,7 +612,6 @@
|
|||
<string name="key_ns_noupload" translatable="false">ns_noupload</string>
|
||||
<string name="basal_step">Basal Step</string>
|
||||
<string name="bolus_step">Bolus Step</string>
|
||||
<string name="stopevent">STOP</string>
|
||||
<string name="extendedbolus">ExtendedBolus</string>
|
||||
<string name="temptarget">TempTarget</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue