Fix DataStoragePlaceDialogFragment
This commit is contained in:
parent
7c069b249f
commit
092a710e0a
1 changed files with 3 additions and 3 deletions
|
@ -122,12 +122,12 @@ public class DataStoragePlaceDialogFragment extends DialogFragment {
|
|||
if (dir.canRead()) {
|
||||
StatFs fs = new StatFs(dir.getAbsolutePath());
|
||||
@SuppressWarnings("deprecation")
|
||||
int size = fs.getAvailableBlocks() * fs.getBlockSize();
|
||||
float size = (float) fs.getAvailableBlocks() * fs.getBlockSize();
|
||||
if (size > 0) {
|
||||
if (size > 1 << 20) {
|
||||
sz = DownloadActivity.formatGb.format(new Object[]{(float) size / (1 << 30)});
|
||||
sz = DownloadActivity.formatGb.format(new Object[]{size / (1 << 30)});
|
||||
} else {
|
||||
sz = DownloadActivity.formatMb.format(new Object[]{(float) size / (1 << 20)});
|
||||
sz = DownloadActivity.formatMb.format(new Object[]{size / (1 << 20)});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue