Skip to content

Commit

Permalink
Building update, displaying "N/A" for as needed in history
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGuidarini committed Dec 11, 2024
1 parent 9fd8176 commit 893bef5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
targetSdkVersion 34
compileSdk 34

versionCode 33
versionName "0.13.4"
versionCode 34
versionName "0.13.5"
resourceConfigurations += ['en', 'de', 'es', 'it', 'tr']

ndk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,18 @@ public void onBindViewHolder(@NonNull HistoryAdapter.ViewHolder holder, int posi
LocalDateTime scheduledDateTime = doses[position].getDoseTime();
LocalDateTime takenDateTime = doses[position].getTimeTaken();

String scheduleDate = DateTimeFormatter.ofPattern(
dateFormat, Locale.getDefault()
).format(scheduledDateTime.toLocalDate());
String scheduleTime = DateTimeFormatter.ofPattern(
timeFormat, Locale.getDefault()
).format(scheduledDateTime.toLocalTime());
if (currentMed.getFrequency() == 0) {
holder.scheduledDateLabel.setText("N/A");
} else {
String scheduleDate = DateTimeFormatter.ofPattern(
dateFormat, Locale.getDefault()
).format(scheduledDateTime.toLocalDate());
String scheduleTime = DateTimeFormatter.ofPattern(
timeFormat, Locale.getDefault()
).format(scheduledDateTime.toLocalTime());

holder.scheduledDateLabel.setText(scheduleDate + "\n" + scheduleTime);
}

String takenDate = DateTimeFormatter.ofPattern(
dateFormat, Locale.getDefault()
Expand All @@ -93,7 +99,6 @@ public void onBindViewHolder(@NonNull HistoryAdapter.ViewHolder holder, int posi
doseLbl += currentMed.getDosageUnits();
}

holder.scheduledDateLabel.setText(scheduleDate + "\n" + scheduleTime);
holder.takenDateLabel.setText(takenDate + "\n" + takenTime);
holder.dosageAmount.setText(doseLbl);

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.2'
classpath 'com.android.tools.build:gradle:8.7.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit 893bef5

Please sign in to comment.