1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 02:39:23 +02:00

file icons

This commit is contained in:
Nikolay Pultsin 2014-08-30 18:45:27 +01:00
parent 7003b3b670
commit 5c237417b3
10 changed files with 25 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 803 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 636 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 696 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 958 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

View 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>

View file

@ -41,6 +41,10 @@ public class FileUtils {
} }
private static boolean accessDenied(IFile f) { private static boolean accessDenied(IFile f) {
if (f.isFile()) {
return !f.canRead();
}
if (!(f instanceof File)) { if (!(f instanceof File)) {
return false; return false;
} }
@ -61,15 +65,14 @@ public class FileUtils {
*/ */
public static int getResIcon(IFile file, final IFileProvider.FilterMode filterMode) { public static int getResIcon(IFile file, final IFileProvider.FilterMode filterMode) {
if (file == null || !file.exists()) if (file == null || !file.exists())
return R.drawable.afc_file; return R.drawable.afc_item_file;
if (file.isFile()) { if (file.isFile()) {
String filename = file.getName(); //String filename = file.getName();
for (String r : _MapFileIcons.keySet()) //for (String r : _MapFileIcons.keySet())
if (filename.matches(r)) // if (filename.matches(r))
return _MapFileIcons.get(r); // return _MapFileIcons.get(r);
return R.drawable.afc_item_file;
return R.drawable.afc_file;
} else if (file.isDirectory()) { } else if (file.isDirectory()) {
if (filterMode == IFileProvider.FilterMode.DirectoriesOnly) { if (filterMode == IFileProvider.FilterMode.DirectoriesOnly) {
if (file instanceof File && !((File)file).canWrite()) { 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() }// getResIcon()
public static boolean isAccessible(IFile file, final String regexp) { public static boolean isAccessible(IFile file, final String regexp) {