Small fixes
This commit is contained in:
parent
5447289720
commit
1f187e218a
1 changed files with 8 additions and 8 deletions
|
@ -679,14 +679,6 @@ public class AndroidUtils {
|
|||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
|
||||
}
|
||||
|
||||
public static float getFreeSpaceGb(File dir) {
|
||||
if (dir.canRead()) {
|
||||
StatFs fs = new StatFs(dir.getAbsolutePath());
|
||||
return (float) (fs.getBlockSize()) * fs.getAvailableBlocks() / (1 << 30);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static ArrayList<View> getChildrenViews(ViewGroup vg) {
|
||||
ArrayList<View> result = new ArrayList<>();
|
||||
for (int i = 0; i < vg.getChildCount(); i++) {
|
||||
|
@ -696,6 +688,14 @@ public class AndroidUtils {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static float getFreeSpaceGb(File dir) {
|
||||
if (dir.canRead()) {
|
||||
StatFs fs = new StatFs(dir.getAbsolutePath());
|
||||
return (float) (fs.getBlockSize()) * fs.getAvailableBlocks() / (1 << 30);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static float getTotalSpaceGb(File dir) {
|
||||
if (dir.canRead()) {
|
||||
return (float) (dir.getTotalSpace()) / (1 << 30);
|
||||
|
|
Loading…
Reference in a new issue