Start cleaning up percentage formatting in Settings.

This fixes some of the percentage formatting issues, but there are
still about ten strings with hard-coded %%s in them.

Bug: 15476051
Change-Id: I668b6b16e598425f6006f6de0005c980f613f5b2
This commit is contained in:
Elliott Hughes
2014-09-02 17:10:14 -07:00
parent b58b512704
commit 7253df35a0
9 changed files with 95 additions and 114 deletions

View File

@@ -26,6 +26,7 @@ import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.android.settings.R;
import com.android.settings.Utils;
public class ProcessStatsPreference extends Preference {
private ProcStatsEntry mEntry;
@@ -61,8 +62,7 @@ public class ProcessStatsPreference extends Preference {
public void setPercent(double percentOfWeight, double percentOfTime) {
mProgress = (int) Math.ceil(percentOfWeight);
mProgressText = getContext().getResources().getString(
R.string.percentage, (int) Math.round(percentOfTime));
mProgressText = Utils.formatPercentage((int) percentOfTime);
notifyChanged();
}