file icons
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 803 B |
BIN
third-party/android-filechooser/code/res/drawable-hdpi/afc_file_disabled.png
vendored
Normal file
After Width: | Height: | Size: 769 B |
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 636 B |
BIN
third-party/android-filechooser/code/res/drawable-ldpi/afc_file_disabled.png
vendored
Normal file
After Width: | Height: | Size: 607 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 696 B |
BIN
third-party/android-filechooser/code/res/drawable-mdpi/afc_file_disabled.png
vendored
Normal file
After Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 958 B |
BIN
third-party/android-filechooser/code/res/drawable-xhdpi/afc_file_disabled.png
vendored
Normal file
After Width: | Height: | Size: 885 B |
14
third-party/android-filechooser/code/res/drawable/afc_item_file.xml
vendored
Executable file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (c) 2012 Hai Bison
|
||||
|
||||
See the file LICENSE at the root directory of this project for copying
|
||||
permission.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/afc_file_disabled" android:state_enabled="false"/> <!-- enabled -->
|
||||
<item android:drawable="@drawable/afc_file"/> <!-- default -->
|
||||
|
||||
</selector>
|
|
@ -41,6 +41,10 @@ public class FileUtils {
|
|||
}
|
||||
|
||||
private static boolean accessDenied(IFile f) {
|
||||
if (f.isFile()) {
|
||||
return !f.canRead();
|
||||
}
|
||||
|
||||
if (!(f instanceof File)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -61,15 +65,14 @@ public class FileUtils {
|
|||
*/
|
||||
public static int getResIcon(IFile file, final IFileProvider.FilterMode filterMode) {
|
||||
if (file == null || !file.exists())
|
||||
return R.drawable.afc_file;
|
||||
return R.drawable.afc_item_file;
|
||||
|
||||
if (file.isFile()) {
|
||||
String filename = file.getName();
|
||||
for (String r : _MapFileIcons.keySet())
|
||||
if (filename.matches(r))
|
||||
return _MapFileIcons.get(r);
|
||||
|
||||
return R.drawable.afc_file;
|
||||
//String filename = file.getName();
|
||||
//for (String r : _MapFileIcons.keySet())
|
||||
// if (filename.matches(r))
|
||||
// return _MapFileIcons.get(r);
|
||||
return R.drawable.afc_item_file;
|
||||
} else if (file.isDirectory()) {
|
||||
if (filterMode == IFileProvider.FilterMode.DirectoriesOnly) {
|
||||
if (file instanceof File && !((File)file).canWrite()) {
|
||||
|
@ -88,7 +91,7 @@ public class FileUtils {
|
|||
}
|
||||
}
|
||||
|
||||
return R.drawable.afc_file;
|
||||
return R.drawable.afc_item_file;
|
||||
}// getResIcon()
|
||||
|
||||
public static boolean isAccessible(IFile file, final String regexp) {
|
||||
|
|