aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
diff options
context:
space:
mode:
authorNathan Grebowiec <njgreb@gmail.com>2013-01-07 15:23:30 -0600
committerJorge Ruesga <jorge@ruesga.com>2013-01-11 23:25:20 +0100
commit4c27ca91ad5ffbc9f976a12aa0a55c975536faa4 (patch)
tree254352df6ad801a6523e249349c4801f8b423b11 /src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
parent9f860753fe1c3030d4e47139102ab91d7a4d22a9 (diff)
downloadandroid_packages_apps_CMFileManager-4c27ca91ad5ffbc9f976a12aa0a55c975536faa4.tar.gz
android_packages_apps_CMFileManager-4c27ca91ad5ffbc9f976a12aa0a55c975536faa4.tar.bz2
android_packages_apps_CMFileManager-4c27ca91ad5ffbc9f976a12aa0a55c975536faa4.zip
Add ability to toggle .nomedia file in storage locations
Patchset 1) Initial commit Patchset 2) Fixed tabs and whitespace Patchset 3) Moved everything to the properties dialog Patchset 4) Clean up Patchset 5) Added check for .nomedia dir Patchset 6) Tab cleanup Patchset 7) Rebase Regorganize FsoPropertiesDialog Refresh navigation listview if a .nomedia file was created or deleted Use FileHelper.deleteFolder instead of DeleteDirCommand Mark/Unmark checkbox when user response no or an error occurs (let checkbox as his initial status) Internationalize error messages Fix nomedia layout id Use match_layout instead of fill_parent (deprecated) Ensure that the fso is a canonical path Use File.exists() to detect the present of .nomedia Theme nomedia label Format code and clean Up Remove W.I.P Patchset 8) Align .nomedia layout Split toggleNoMediaFile logic Ask user if .nomedia file is not empty Fix typos Patchset 9) Fix typo Change-Id: I048d1da75f24230380aa7503f2d2c9ad95f9b873
Diffstat (limited to 'src/com/cyanogenmod/filemanager/activities/NavigationActivity.java')
-rw-r--r--src/com/cyanogenmod/filemanager/activities/NavigationActivity.java32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
index 3221002e..26aaebde 100644
--- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
@@ -606,6 +606,14 @@ public class NavigationActivity extends Activity
FileManagerSettings.SETTINGS_INITIAL_DIR.getId(),
(String)FileManagerSettings.
SETTINGS_INITIAL_DIR.getDefaultValue());
+
+ // Check if request navigation to directory (use as default), and
+ // ensure chrooted and absolute path
+ String navigateTo = getIntent().getStringExtra(EXTRA_NAVIGATE_TO);
+ if (navigateTo != null && navigateTo.length() > 0) {
+ initialDir = navigateTo;
+ }
+
if (NavigationActivity.this.mChRooted) {
// Initial directory is the first external sdcard (sdcard, emmc, usb, ...)
StorageVolume[] volumes =
@@ -622,27 +630,11 @@ public class NavigationActivity extends Activity
}
}
- //Ensure initial is an absolute directory
- try {
- initialDir = new File(initialDir).getAbsolutePath();
- } catch (Throwable e) {
- Log.e(TAG, "Resolve of initital directory fails", e); //$NON-NLS-1$
- String msg =
- getString(
- R.string.msgs_settings_invalid_initial_directory,
- initialDir);
- DialogHelper.showToast(NavigationActivity.this, msg, Toast.LENGTH_SHORT);
- initialDir = FileHelper.ROOT_DIRECTORY;
- }
+ //Ensure that initial directory is an absolute directory
+ initialDir = FileHelper.getAbsPath(initialDir);
- // Change the current directory to the preference initial directory or the
- // request if exists
- String navigateTo = getIntent().getStringExtra(EXTRA_NAVIGATE_TO);
- if (navigateTo != null && navigateTo.length() > 0) {
- navigationView.changeCurrentDir(navigateTo);
- } else {
- navigationView.changeCurrentDir(initialDir);
- }
+ // Change the current directory to the preference initial directory
+ navigationView.changeCurrentDir(initialDir);
}
}
});