Add TDD to DanaR daily view

... also don't show the time for the day. It is always 00:00 anyways.
This commit is contained in:
AdrianLxM 2016-11-08 06:11:50 +01:00 committed by GitHub
parent ede982c8c5
commit ff66edf064

View file

@ -281,8 +281,6 @@ public class DanaRHistoryActivity extends Activity {
holder.stringvalue.setText(record.getStringRecordValue()); holder.stringvalue.setText(record.getStringRecordValue());
holder.bolustype.setText(record.getBolusType()); holder.bolustype.setText(record.getBolusType());
holder.duration.setText(DecimalFormatter.to0Decimal(record.getRecordDuration())); holder.duration.setText(DecimalFormatter.to0Decimal(record.getRecordDuration()));
holder.dailybasal.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBasal()) + "U");
holder.dailybolus.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBolus()) + "U");
holder.alarm.setText(record.getRecordAlarm()); holder.alarm.setText(record.getRecordAlarm());
switch (showingType) { switch (showingType) {
case RecordTypes.RECORD_TYPE_ALARM: case RecordTypes.RECORD_TYPE_ALARM:
@ -293,6 +291,7 @@ public class DanaRHistoryActivity extends Activity {
holder.duration.setVisibility(View.GONE); holder.duration.setVisibility(View.GONE);
holder.dailybasal.setVisibility(View.GONE); holder.dailybasal.setVisibility(View.GONE);
holder.dailybolus.setVisibility(View.GONE); holder.dailybolus.setVisibility(View.GONE);
holder.dailytotal.setVisibility(View.GONE);
holder.alarm.setVisibility(View.VISIBLE); holder.alarm.setVisibility(View.VISIBLE);
break; break;
case RecordTypes.RECORD_TYPE_BOLUS: case RecordTypes.RECORD_TYPE_BOLUS:
@ -303,9 +302,15 @@ public class DanaRHistoryActivity extends Activity {
holder.duration.setVisibility(View.VISIBLE); holder.duration.setVisibility(View.VISIBLE);
holder.dailybasal.setVisibility(View.GONE); holder.dailybasal.setVisibility(View.GONE);
holder.dailybolus.setVisibility(View.GONE); holder.dailybolus.setVisibility(View.GONE);
holder.dailytotal.setVisibility(View.GONE);
holder.alarm.setVisibility(View.GONE); holder.alarm.setVisibility(View.GONE);
break; break;
case RecordTypes.RECORD_TYPE_DAILY: case RecordTypes.RECORD_TYPE_DAILY:
df = DateFormat.getDateInstance(DateFormat.SHORT);
holder.dailybasal.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBasal()) + "U");
holder.dailybolus.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBolus()) + "U");
holder.dailytotal.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBolus()+ record.getRecordDailyBasal()) + "U");
holder.time.setText(df.format(new Date(record.getRecordDate())));
holder.time.setVisibility(View.VISIBLE); holder.time.setVisibility(View.VISIBLE);
holder.value.setVisibility(View.GONE); holder.value.setVisibility(View.GONE);
holder.stringvalue.setVisibility(View.GONE); holder.stringvalue.setVisibility(View.GONE);
@ -313,6 +318,7 @@ public class DanaRHistoryActivity extends Activity {
holder.duration.setVisibility(View.GONE); holder.duration.setVisibility(View.GONE);
holder.dailybasal.setVisibility(View.VISIBLE); holder.dailybasal.setVisibility(View.VISIBLE);
holder.dailybolus.setVisibility(View.VISIBLE); holder.dailybolus.setVisibility(View.VISIBLE);
holder.dailytotal.setVisibility(View.VISIBLE);
holder.alarm.setVisibility(View.GONE); holder.alarm.setVisibility(View.GONE);
break; break;
case RecordTypes.RECORD_TYPE_GLUCOSE: case RecordTypes.RECORD_TYPE_GLUCOSE:
@ -331,6 +337,7 @@ public class DanaRHistoryActivity extends Activity {
holder.duration.setVisibility(View.GONE); holder.duration.setVisibility(View.GONE);
holder.dailybasal.setVisibility(View.GONE); holder.dailybasal.setVisibility(View.GONE);
holder.dailybolus.setVisibility(View.GONE); holder.dailybolus.setVisibility(View.GONE);
holder.dailytotal.setVisibility(View.GONE);
holder.alarm.setVisibility(View.GONE); holder.alarm.setVisibility(View.GONE);
break; break;
case RecordTypes.RECORD_TYPE_SUSPEND: case RecordTypes.RECORD_TYPE_SUSPEND:
@ -341,6 +348,7 @@ public class DanaRHistoryActivity extends Activity {
holder.duration.setVisibility(View.GONE); holder.duration.setVisibility(View.GONE);
holder.dailybasal.setVisibility(View.GONE); holder.dailybasal.setVisibility(View.GONE);
holder.dailybolus.setVisibility(View.GONE); holder.dailybolus.setVisibility(View.GONE);
holder.dailytotal.setVisibility(View.GONE);
holder.alarm.setVisibility(View.GONE); holder.alarm.setVisibility(View.GONE);
break; break;
} }
@ -365,6 +373,7 @@ public class DanaRHistoryActivity extends Activity {
TextView duration; TextView duration;
TextView dailybasal; TextView dailybasal;
TextView dailybolus; TextView dailybolus;
TextView dailytotal;
TextView alarm; TextView alarm;
HistoryViewHolder(View itemView) { HistoryViewHolder(View itemView) {
@ -377,6 +386,7 @@ public class DanaRHistoryActivity extends Activity {
duration = (TextView) itemView.findViewById(R.id.danar_history_duration); duration = (TextView) itemView.findViewById(R.id.danar_history_duration);
dailybasal = (TextView) itemView.findViewById(R.id.danar_history_dailybasal); dailybasal = (TextView) itemView.findViewById(R.id.danar_history_dailybasal);
dailybolus = (TextView) itemView.findViewById(R.id.danar_history_dailybolus); dailybolus = (TextView) itemView.findViewById(R.id.danar_history_dailybolus);
dailytotal = (TextView) itemView.findViewById(R.id.danar_history_dailytotal);
alarm = (TextView) itemView.findViewById(R.id.danar_history_alarm); alarm = (TextView) itemView.findViewById(R.id.danar_history_alarm);
} }
} }