mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-20 07:21:40 +02:00
Don't override and use setNameView to set name
as it makes name contain the delta value as well (as setNameView is called to set name + delta).
This commit is contained in:
@@ -31,7 +31,7 @@ public class Caliper1MeasurementView extends FloatMeasurementView {
|
||||
super(context, R.string.label_caliper1_female, R.drawable.ic_caliper1);
|
||||
|
||||
if (getScaleUser().getGender().isMale()) {
|
||||
setNameView(getResources().getText(R.string.label_caliper1_male));
|
||||
setName(R.string.label_caliper1_male);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ public class Caliper2MeasurementView extends FloatMeasurementView {
|
||||
super(context, R.string.label_caliper2_female, R.drawable.ic_caliper2);
|
||||
|
||||
if (getScaleUser().getGender().isMale()) {
|
||||
setNameView(getResources().getText(R.string.label_caliper2_male));
|
||||
setName(R.string.label_caliper2_male);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ public class Caliper3MeasurementView extends FloatMeasurementView {
|
||||
super(context, R.string.label_caliper3_female, R.drawable.ic_caliper3);
|
||||
|
||||
if (getScaleUser().getGender().isMale()) {
|
||||
setNameView(getResources().getText(R.string.label_caliper3_male));
|
||||
setName(R.string.label_caliper3_male);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -413,6 +413,11 @@ public abstract class FloatMeasurementView extends MeasurementView {
|
||||
return nameText;
|
||||
}
|
||||
|
||||
protected void setName(int textId) {
|
||||
nameText = getResources().getString(textId);
|
||||
setNameView(nameText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendDiffValue(SpannableStringBuilder text, boolean newLine) {
|
||||
if (previousValue < 0.0f) {
|
||||
@@ -474,13 +479,6 @@ public abstract class FloatMeasurementView extends MeasurementView {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setNameView(CharSequence text) {
|
||||
super.setNameView(text);
|
||||
|
||||
nameText = text.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpand(boolean state) {
|
||||
final boolean show = state && isVisible() && evaluationResult != null;
|
||||
|
Reference in New Issue
Block a user