Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Integrated Dummy Heart Rate Announcement to real time
Browse files Browse the repository at this point in the history
  • Loading branch information
anash3420 committed Nov 25, 2023
1 parent ee7c2b7 commit fa43187
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,12 @@ static Spannable getAnnouncement(Context context, TrackStatistics trackStatistic
appendCardinal(builder, context.getString(R.string.sensor_state_heart_rate_value, currentHeartRate), currentHeartRate);
builder.append(".");
}

if(shouldVoiceAnnounceCurrentHeartRate()){
builder.append(context.getString(R.string.current_heart_rate))
.append(" ")
.append("80");
if(shouldVoiceAnnounceCurrentHeartRate() && currentInterval != null && currentInterval.hasAverageHeartRate()){
int currentHeartRate = Math.round(currentInterval.getAverageHeartRate().getBPM());
builder.append(context.getString(R.string.current_heart_rate)).append(" ").append(String.valueOf(currentHeartRate));
builder.append(".");
        }
}

return builder;
}

Expand Down Expand Up @@ -212,5 +210,4 @@ private static void appendCardinal(@NonNull SpannableStringBuilder builder, @Non
builder.append(" ")
.append(localizedText, new TtsSpan.CardinalBuilder().setNumber(number).build(), SPAN_INCLUSIVE_EXCLUSIVE);
}
}

}

0 comments on commit fa43187

Please sign in to comment.