Merge "Add blob size to shared data dev options screens." into rvc-dev am: eef7b5e7e3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11764432 Change-Id: Id8ad9c5edcb475c26e3474af7c53ce1422d68291
This commit is contained in:
@@ -158,6 +158,7 @@ public class BlobInfoListView extends ListActivity {
|
||||
holder.blobId.setText(getString(R.string.blob_id_text, blob.getId()));
|
||||
holder.blobExpiry.setText(getString(R.string.blob_expires_text,
|
||||
SharedDataUtils.formatTime(blob.getExpiryTimeMs())));
|
||||
holder.blobSize.setText(SharedDataUtils.formatSize(blob.getSizeBytes()));
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ class BlobInfoViewHolder {
|
||||
TextView blobLabel;
|
||||
TextView blobId;
|
||||
TextView blobExpiry;
|
||||
TextView blobSize;
|
||||
|
||||
static BlobInfoViewHolder createOrRecycle(LayoutInflater inflater, View convertView) {
|
||||
if (convertView != null) {
|
||||
@@ -42,6 +43,7 @@ class BlobInfoViewHolder {
|
||||
holder.blobLabel = convertView.findViewById(R.id.blob_label);
|
||||
holder.blobId = convertView.findViewById(R.id.blob_id);
|
||||
holder.blobExpiry = convertView.findViewById(R.id.blob_expiry);
|
||||
holder.blobSize = convertView.findViewById(R.id.blob_size);
|
||||
convertView.setTag(holder);
|
||||
return holder;
|
||||
}
|
||||
|
@@ -93,11 +93,13 @@ public class LeaseInfoListView extends ListActivity {
|
||||
final TextView blobLabel = headerView.findViewById(R.id.blob_label);
|
||||
final TextView blobId = headerView.findViewById(R.id.blob_id);
|
||||
final TextView blobExpiry = headerView.findViewById(R.id.blob_expiry);
|
||||
final TextView blobSize = headerView.findViewById(R.id.blob_size);
|
||||
|
||||
blobLabel.setText(mBlobInfo.getLabel());
|
||||
blobLabel.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
blobId.setText(getString(R.string.blob_id_text, mBlobInfo.getId()));
|
||||
blobExpiry.setVisibility(View.GONE);
|
||||
blobSize.setText(SharedDataUtils.formatSize(mBlobInfo.getSizeBytes()));
|
||||
return headerView;
|
||||
}
|
||||
|
||||
|
@@ -39,4 +39,9 @@ class SharedDataUtils {
|
||||
CALENDAR.setTimeInMillis(millis);
|
||||
return FORMATTER.format(CALENDAR.getTime());
|
||||
}
|
||||
|
||||
static String formatSize(long sizeBytes) {
|
||||
final double sizeInMb = sizeBytes / (1024.0 * 1024.0);
|
||||
return String.format("%.2f MB", sizeInMb);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user