Merge "Fix formats and internationalization of the string "0.6 seconds" in sk language" into rvc-dev am: 24f71c6e91

Change-Id: I1f61856a89598b4d72bdf9873e0e7ac63e50f53f
This commit is contained in:
Menghan Li
2020-04-27 14:40:56 +00:00
committed by Automerger Merge Worker
3 changed files with 7 additions and 4 deletions

View File

@@ -205,7 +205,7 @@ public class ToggleAutoclickCustomSeekbarController extends BasePreferenceContro
}
private CharSequence delayTimeToString(int delayMillis) {
final int quantity = (delayMillis == 1000) ? Quantity.ONE : Quantity.OTHER;
final int quantity = (delayMillis == 1000) ? Quantity.ONE : Quantity.FEW;
final float delaySecond = (float) delayMillis / 1000;
// Only show integer when delay time is 1.
final String decimalFormat = (delaySecond == 1) ? "%.0f" : "%.1f";

View File

@@ -53,11 +53,13 @@ public class ToggleAutoclickPreferenceFragment extends DashboardFragment
@Retention(SOURCE)
@IntDef({
Quantity.OTHER,
Quantity.ONE
Quantity.ONE,
Quantity.FEW
})
@interface Quantity {
int OTHER = 0;
int ONE = 1;
int FEW = 3;
}
/**
@@ -79,7 +81,7 @@ public class ToggleAutoclickPreferenceFragment extends DashboardFragment
*/
static CharSequence getAutoclickPreferenceSummary(Resources resources, int delayMillis) {
final int summaryIndex = getAutoclickPreferenceSummaryIndex(delayMillis);
final int quantity = (delayMillis == 1000) ? Quantity.ONE : Quantity.OTHER;
final int quantity = (delayMillis == 1000) ? Quantity.ONE : Quantity.FEW;
final float delaySecond = (float) delayMillis / 1000;
// Only show integer when delay time is 1.
final String decimalFormat = (delaySecond == 1) ? "%.0f" : "%.1f";