Merge "Revert "Don't use framework strings for formatting file sizes""
This commit is contained in:
@@ -24,8 +24,6 @@ import android.app.Fragment;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.icu.text.MeasureFormat;
|
|
||||||
import android.icu.util.MeasureUnit;
|
|
||||||
import android.net.NetworkPolicy;
|
import android.net.NetworkPolicy;
|
||||||
import android.net.NetworkTemplate;
|
import android.net.NetworkTemplate;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -36,7 +34,6 @@ import android.text.format.Time;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.NumberPicker;
|
import android.widget.NumberPicker;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
@@ -256,17 +253,6 @@ public class BillingCycleSettings extends DataUsageBase implements
|
|||||||
: editor.getPolicyWarningBytes(template);
|
: editor.getPolicyWarningBytes(template);
|
||||||
final long limitDisabled = isLimit ? LIMIT_DISABLED : WARNING_DISABLED;
|
final long limitDisabled = isLimit ? LIMIT_DISABLED : WARNING_DISABLED;
|
||||||
|
|
||||||
final MeasureFormat formatter = MeasureFormat.getInstance(
|
|
||||||
getContext().getResources().getConfiguration().locale,
|
|
||||||
MeasureFormat.FormatWidth.SHORT);
|
|
||||||
final String[] unitNames = new String[] {
|
|
||||||
formatter.getUnitDisplayName(MeasureUnit.MEGABYTE),
|
|
||||||
formatter.getUnitDisplayName(MeasureUnit.GIGABYTE)
|
|
||||||
};
|
|
||||||
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(
|
|
||||||
getContext(), R.layout.data_usage_spinner_item, unitNames);
|
|
||||||
type.setAdapter(adapter);
|
|
||||||
|
|
||||||
if (bytes > 1.5f * GB_IN_BYTES) {
|
if (bytes > 1.5f * GB_IN_BYTES) {
|
||||||
final String bytesText = formatText(bytes / (float) GB_IN_BYTES);
|
final String bytesText = formatText(bytes / (float) GB_IN_BYTES);
|
||||||
bytesPicker.setText(bytesText);
|
bytesPicker.setText(bytesText);
|
||||||
|
|||||||
Reference in New Issue
Block a user