Skip to content

Commit 8dd2c0f

Browse files
rav7kantsinghCloudyPadmal
authored andcommitted
Fixes #1967 deg text to its symbol (#1972)
1 parent 9a448b0 commit 8dd2c0f

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,15 @@ public void onClick(View view) {
420420
seekBar.setOnSeekChangeListener(new IndicatorSeekBar.OnSeekBarChangeListener() {
421421
@Override
422422
public void onProgressChanged(IndicatorSeekBar seekBar, int progress, float progressFloat, boolean fromUserTouch) {
423-
String valueText = progress + " " + unit;
423+
String valueText;
424+
switch (unit) {
425+
case "\u00b0":
426+
valueText = progress + unit;
427+
break;
428+
default:
429+
valueText = progress + " " + unit;
430+
}
431+
424432
if (waveMonSelected) {
425433
waveMonPropValueSelect.setText(valueText);
426434
} else {
@@ -813,7 +821,14 @@ private void toggleDigitalMode(WaveConst mode) {
813821

814822
private void fetchPropertyValue(WaveConst btnActive, WaveConst property, String unit, TextView propTextView) {
815823
Double value = (double) WaveGeneratorCommon.wave.get(btnActive).get(property);
816-
String valueText = value.intValue() + " " + unit;
824+
String valueText;
825+
switch (unit) {
826+
case "\u00b0":
827+
valueText = value.intValue() + unit;
828+
break;
829+
default:
830+
valueText = value.intValue() + " " + unit;
831+
}
817832
propTextView.setText(valueText);
818833
}
819834

@@ -908,7 +923,14 @@ private void setValue() {
908923
setWave();
909924
previewWave();
910925
Double dValue = (double) value;
911-
String valueText = String.valueOf(dValue.intValue()) + " " + unit;
926+
String valueText;
927+
switch (unit) {
928+
case "\u00b0":
929+
valueText = String.valueOf(dValue.intValue()) + unit;
930+
break;
931+
default:
932+
valueText = String.valueOf(dValue.intValue()) + " " + unit;
933+
}
912934
activePropTv.setText(valueText);
913935
}
914936

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@
660660
<string name="unit_hz">Hz</string>
661661
<string name="text_phase_colon">Phase :</string>
662662
<string name="text_phase">Phase</string>
663-
<string name="deg_text">deg</string>
663+
<string name="deg_text">\u00b0</string>
664664
<string name="selected_text_holder">Wave Frequency :</string>
665665
<string name="text_sq1">SQR1</string>
666666
<string name="text_sq2">SQR2</string>
@@ -678,7 +678,7 @@
678678
<string name="view_text">View</string>
679679
<string name="produce_sound_text">Produce Sound</string>
680680
<string name="save_text">Save</string>
681-
<string name="phase_holder_text">45 deg</string>
681+
<string name="phase_holder_text">45\u00b0</string>
682682
<string name="duty_holder_text">50 %</string>
683683
<string name="open_instrument">Open instrument</string>
684684

0 commit comments

Comments
 (0)