add a (hidden) postfix to hidden folders

This commit is contained in:
tibbi 2016-10-09 15:18:45 +02:00
parent 7b7788b03c
commit 5d1126d0f8
8 changed files with 19 additions and 8 deletions

View file

@ -203,9 +203,9 @@ public class MainActivity extends SimpleActivity
if (cursor != null && cursor.moveToFirst()) { if (cursor != null && cursor.moveToFirst()) {
final int pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA); final int pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
do { do {
final String path = cursor.getString(pathIndex); final String fullPath = cursor.getString(pathIndex);
final File file = new File(path); final File file = new File(fullPath);
final String fileDir = file.getParent(); final String parentDir = file.getParent();
if (!file.exists()) { if (!file.exists()) {
invalidFiles.add(file.getAbsolutePath()); invalidFiles.add(file.getAbsolutePath());
@ -214,14 +214,18 @@ public class MainActivity extends SimpleActivity
final int dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); final int dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN);
final long timestamp = cursor.getLong(dateIndex); final long timestamp = cursor.getLong(dateIndex);
if (directories.containsKey(fileDir)) { if (directories.containsKey(parentDir)) {
final Directory directory = directories.get(fileDir); final Directory directory = directories.get(parentDir);
final int newImageCnt = directory.getMediaCnt() + 1; final int newImageCnt = directory.getMediaCnt() + 1;
directory.setMediaCnt(newImageCnt); directory.setMediaCnt(newImageCnt);
directory.addSize(file.length()); directory.addSize(file.length());
} else if (!mToBeDeleted.contains(fileDir)) { } else if (!mToBeDeleted.contains(parentDir)) {
final String dirName = Utils.getFilename(fileDir); String dirName = Utils.getFilename(parentDir);
directories.put(fileDir, new Directory(fileDir, path, dirName, 1, timestamp, file.length())); if (mConfig.getIsFolderHidden(parentDir)) {
dirName += " " + getResources().getString(R.string.hidden);
}
directories.put(parentDir, new Directory(parentDir, fullPath, dirName, 1, timestamp, file.length()));
} }
} while (cursor.moveToNext()); } while (cursor.moveToNext());
cursor.close(); cursor.close();

View file

@ -33,6 +33,7 @@
<string name="no_app_found">No valid app found</string> <string name="no_app_found">No valid app found</string>
<string name="hide_folder">Hide folder</string> <string name="hide_folder">Hide folder</string>
<string name="unhide_folder">Unhide folder</string> <string name="unhide_folder">Unhide folder</string>
<string name="hidden">(hidden)</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 Ordner gelöscht</item> <item quantity="one">1 Ordner gelöscht</item>

View file

@ -33,6 +33,7 @@
<string name="no_app_found">No valid app found</string> <string name="no_app_found">No valid app found</string>
<string name="hide_folder">Hide folder</string> <string name="hide_folder">Hide folder</string>
<string name="unhide_folder">Unhide folder</string> <string name="unhide_folder">Unhide folder</string>
<string name="hidden">(hidden)</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 carpeta eliminada</item> <item quantity="one">1 carpeta eliminada</item>

View file

@ -33,6 +33,7 @@
<string name="no_app_found">No valid app found</string> <string name="no_app_found">No valid app found</string>
<string name="hide_folder">Hide folder</string> <string name="hide_folder">Hide folder</string>
<string name="unhide_folder">Unhide folder</string> <string name="unhide_folder">Unhide folder</string>
<string name="hidden">(hidden)</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 cartella eliminata</item> <item quantity="one">1 cartella eliminata</item>

View file

@ -33,6 +33,7 @@
<string name="no_app_found">No valid app found</string> <string name="no_app_found">No valid app found</string>
<string name="hide_folder">Hide folder</string> <string name="hide_folder">Hide folder</string>
<string name="unhide_folder">Unhide folder</string> <string name="unhide_folder">Unhide folder</string>
<string name="hidden">(hidden)</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 フォルダーを削除しました</item> <item quantity="one">1 フォルダーを削除しました</item>

View file

@ -33,6 +33,7 @@
<string name="no_app_found">No valid app found</string> <string name="no_app_found">No valid app found</string>
<string name="hide_folder">Hide folder</string> <string name="hide_folder">Hide folder</string>
<string name="unhide_folder">Unhide folder</string> <string name="unhide_folder">Unhide folder</string>
<string name="hidden">(hidden)</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 pasta eliminada</item> <item quantity="one">1 pasta eliminada</item>

View file

@ -33,6 +33,7 @@
<string name="no_app_found">No valid app found</string> <string name="no_app_found">No valid app found</string>
<string name="hide_folder">Hide folder</string> <string name="hide_folder">Hide folder</string>
<string name="unhide_folder">Unhide folder</string> <string name="unhide_folder">Unhide folder</string>
<string name="hidden">(hidden)</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 mapp borttagen</item> <item quantity="one">1 mapp borttagen</item>

View file

@ -33,6 +33,7 @@
<string name="no_app_found">No valid app found</string> <string name="no_app_found">No valid app found</string>
<string name="hide_folder">Hide folder</string> <string name="hide_folder">Hide folder</string>
<string name="unhide_folder">Unhide folder</string> <string name="unhide_folder">Unhide folder</string>
<string name="hidden">(hidden)</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 folder deleted</item> <item quantity="one">1 folder deleted</item>