Permission aware file browsing, Restore menu size
Since the BIOS cannot be stored on external storage, there is absolutely no reason to begin a search from that folder. It makes more sense to start from a user-defined folder than the default simply because an external card exists. A check has been added to see if the preference is a default.
This commit is contained in:
parent
70b93b4d86
commit
627d5eb301
|
@ -21,8 +21,8 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/item_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginLeft="6dp"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/item_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginLeft="6dp"
|
||||
|
|
|
@ -279,21 +279,23 @@ public class FileBrowser extends Fragment {
|
|||
}
|
||||
|
||||
private void browseStorage(boolean images) {
|
||||
HashSet<String> extStorage = FileBrowser.getExternalMounts();
|
||||
if (extStorage != null && !extStorage.isEmpty()) {
|
||||
for (Iterator<String> sd = extStorage.iterator(); sd.hasNext();) {
|
||||
String sdCardPath = sd.next().replace("mnt/media_rw", "storage");
|
||||
if (!sdCardPath.equals(sdcard.getAbsolutePath())) {
|
||||
if (new File(sdCardPath).canRead()) {
|
||||
navigate(new File(sdCardPath));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (images) {
|
||||
navigate(new File(home_directory));
|
||||
} else {
|
||||
if (game_directory.equals(sdcard.getAbsolutePath().replace("emulated/0", "sdcard0"))) {
|
||||
HashSet<String> extStorage = FileBrowser.getExternalMounts();
|
||||
if (extStorage != null && !extStorage.isEmpty()) {
|
||||
for (Iterator<String> sd = extStorage.iterator(); sd.hasNext();) {
|
||||
String sdCardPath = sd.next().replace("mnt/media_rw", "storage");
|
||||
if (!sdCardPath.equals(sdcard.getAbsolutePath())) {
|
||||
if (new File(sdCardPath).canRead()) {
|
||||
navigate(new File(sdCardPath));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
navigate(new File(game_directory));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue