forked from upstream-mirrors/OpenTracks
@@ -3,6 +3,7 @@ package de.dennisguse.opentracks.data.models;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import de.dennisguse.opentracks.R;
|
||||
import de.dennisguse.opentracks.ui.util.ThemeUtils;
|
||||
@@ -15,19 +16,19 @@ public class HeartRateZones {
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public int getColorForZone(Context context, HeartRate current) {
|
||||
public int getTextColorForZone(Context context, HeartRate current) {
|
||||
if (current != null) {
|
||||
if (current.getBPM() >= max.getBPM() * 0.9) {
|
||||
return R.color.heart_rate_zone_textcolor_5;
|
||||
return ContextCompat.getColor(context, R.color.heart_rate_zone_textcolor_5);
|
||||
}
|
||||
if (current.getBPM() >= max.getBPM() * 0.8) {
|
||||
return R.color.heart_rate_zone_textcolor_4;
|
||||
return ContextCompat.getColor(context, R.color.heart_rate_zone_textcolor_4);
|
||||
}
|
||||
if (current.getBPM() >= max.getBPM() * 0.7) {
|
||||
return R.color.heart_rate_zone_textcolor_3;
|
||||
return ContextCompat.getColor(context, R.color.heart_rate_zone_textcolor_3);
|
||||
}
|
||||
if (current.getBPM() >= max.getBPM() * 0.6) {
|
||||
return R.color.heart_rate_zone_textcolor_2;
|
||||
return ContextCompat.getColor(context, R.color.heart_rate_zone_textcolor_2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user