Updater: use consistent format for file sizes
Change-Id: I9a17cf2df69e2e39e90de169ca108511c71d4e31 Signed-off-by: Joey <joey@lineageos.org>
This commit is contained in:
@@ -157,7 +157,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
|
||||
final String downloadId = update.getDownloadId();
|
||||
if (mUpdaterController.isDownloading(downloadId)) {
|
||||
canDelete = true;
|
||||
String downloaded = StringGenerator.bytesToMegabytes(mActivity,
|
||||
String downloaded = Formatter.formatShortFileSize(mActivity,
|
||||
update.getFile().length());
|
||||
String total = Formatter.formatShortFileSize(mActivity, update.getFileSize());
|
||||
String percentage = NumberFormat.getPercentInstance().format(
|
||||
@@ -191,7 +191,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
|
||||
} else {
|
||||
canDelete = true;
|
||||
setButtonAction(viewHolder.mAction, Action.RESUME, downloadId, !isBusy());
|
||||
String downloaded = StringGenerator.bytesToMegabytes(mActivity,
|
||||
String downloaded = Formatter.formatShortFileSize(mActivity,
|
||||
update.getFile().length());
|
||||
String total = Formatter.formatShortFileSize(mActivity, update.getFileSize());
|
||||
String percentage = NumberFormat.getPercentInstance().format(
|
||||
|
@@ -49,10 +49,6 @@ public final class StringGenerator {
|
||||
return f.format(date);
|
||||
}
|
||||
|
||||
public static String bytesToMegabytes(Context context, long bytes) {
|
||||
return String.format(getCurrentLocale(context), "%.0f", bytes / 1024.f / 1024.f);
|
||||
}
|
||||
|
||||
public static String formatETA(Context context, long millis) {
|
||||
final long SECOND_IN_MILLIS = 1000;
|
||||
final long MINUTE_IN_MILLIS = SECOND_IN_MILLIS * 60;
|
||||
|
Reference in New Issue
Block a user