Commit bc8ede8e authored by Riegel's avatar Riegel
Browse files

Refactor: Rename variables

parent fb528f1d
Showing with 9 additions and 9 deletions
+9 -9
...@@ -137,18 +137,18 @@ public class ZipEntryPicker { ...@@ -137,18 +137,18 @@ public class ZipEntryPicker {
subpathValueTxt.setText(entry.getFileName()); subpathValueTxt.setText(entry.getFileName());
if (entry.getFileSize() != -1L) { if (entry.getFileSize() != -1L) {
long fileSize = entry.getFileSize(); long fileSize = entry.getFileSize();
long KB = 1024L; long kb = 1024L;
long MB = KB * KB; long mb = kb * kb;
long GB = MB * KB; long gb = mb * kb;
if (fileSize < KB) { if (fileSize < kb) {
filesizeValue.setText("< 1 KB"); filesizeValue.setText("< 1 KB");
} else if (fileSize < MB) { } else if (fileSize < mb) {
filesizeValue.setText(String.format("%s KB", fileSize / KB)); filesizeValue.setText(String.format("%s KB", fileSize / kb));
} else if (fileSize < GB) { } else if (fileSize < gb) {
filesizeValue.setText(String.format("%s MB", fileSize / MB)); filesizeValue.setText(String.format("%s MB", fileSize / mb));
} else { } else {
double gigabytes = (double) fileSize / GB; double gigabytes = (double) fileSize / gb;
filesizeValue.setText(String.format("%.2f GB", gigabytes)); filesizeValue.setText(String.format("%.2f GB", gigabytes));
} }
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment