From 252803eaa69853d63ec0a0acbe751205f9ad9e6c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 5 Sep 2016 20:47:49 +0200 Subject: [PATCH] add a switch for showing full folder paths --- .../simplemobiletools/filemanager/Config.java | 8 +++++ .../filemanager/Constants.java | 1 + .../activities/SettingsActivity.java | 12 ++++++++ app/src/main/res/layout/activity_settings.xml | 30 +++++++++++++++++-- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 9 files changed, 54 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/filemanager/Config.java b/app/src/main/java/com/simplemobiletools/filemanager/Config.java index 2d54aefc..1d298907 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/Config.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/Config.java @@ -37,4 +37,12 @@ public class Config { public void setShowHidden(boolean show) { mPrefs.edit().putBoolean(Constants.SHOW_HIDDEN, show).apply(); } + + public boolean getShowFullPath() { + return mPrefs.getBoolean(Constants.SHOW_FULL_PATH, false); + } + + public void setShowFullPath(boolean show) { + mPrefs.edit().putBoolean(Constants.SHOW_FULL_PATH, show).apply(); + } } diff --git a/app/src/main/java/com/simplemobiletools/filemanager/Constants.java b/app/src/main/java/com/simplemobiletools/filemanager/Constants.java index 30f531a7..00e6bbe7 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/Constants.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/Constants.java @@ -8,4 +8,5 @@ public class Constants { public static final String IS_FIRST_RUN = "is_first_run"; public static final String IS_DARK_THEME = "is_dark_theme"; public static final String SHOW_HIDDEN = "show_hidden"; + public static final String SHOW_FULL_PATH = "show_full_path"; } diff --git a/app/src/main/java/com/simplemobiletools/filemanager/activities/SettingsActivity.java b/app/src/main/java/com/simplemobiletools/filemanager/activities/SettingsActivity.java index ece88202..c12122ab 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/activities/SettingsActivity.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/activities/SettingsActivity.java @@ -14,6 +14,7 @@ import butterknife.OnClick; public class SettingsActivity extends SimpleActivity { @BindView(R.id.settings_dark_theme) SwitchCompat mDarkThemeSwitch; @BindView(R.id.settings_show_hidden) SwitchCompat mShowHiddenSwitch; + @BindView(R.id.settings_show_full_path) SwitchCompat mShowFullPathSwitch; private static Config mConfig; @@ -26,6 +27,7 @@ public class SettingsActivity extends SimpleActivity { setupDarkTheme(); setupShowHidden(); + setupShowFullPath(); } private void setupDarkTheme() { @@ -36,6 +38,10 @@ public class SettingsActivity extends SimpleActivity { mShowHiddenSwitch.setChecked(mConfig.getShowHidden()); } + private void setupShowFullPath() { + mShowFullPathSwitch.setChecked(mConfig.getShowFullPath()); + } + @OnClick(R.id.settings_dark_theme_holder) public void handleDarkTheme() { mDarkThemeSwitch.setChecked(!mDarkThemeSwitch.isChecked()); @@ -49,6 +55,12 @@ public class SettingsActivity extends SimpleActivity { mConfig.setShowHidden(mShowHiddenSwitch.isChecked()); } + @OnClick(R.id.settings_show_full_path_holder) + public void handleShowFullPath() { + mShowFullPathSwitch.setChecked(!mShowFullPathSwitch.isChecked()); + mConfig.setShowFullPath(mShowFullPathSwitch.isChecked()); + } + private void restartActivity() { TaskStackBuilder.create(getApplicationContext()).addNextIntentWithParentStack(getIntent()).startActivities(); } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 4b185fc4..b4bd803e 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -16,7 +16,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/settings_padding" - android:background="?android:attr/selectableItemBackground" + android:background="?attr/selectableItemBackground" android:padding="@dimen/activity_margin"> + + + + + + + + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 52f63a3f..33f822aa 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -65,4 +65,5 @@ Einstellungen Dunkles Thema Zeige versteckte Dateien und Ordner + Show full path diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index c8b7d993..6a0ab79e 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -65,4 +65,5 @@ Impostazioni Tema scuro Mostra file e cartelle nascosti + Show full path diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index fab0d9f2..8d088486 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -65,4 +65,5 @@ 設定 ダークテーマ 非表示のファイルとディレクトリーを表示する + Show full path diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 16076ad6..aa15e651 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -65,4 +65,5 @@ Settings Mörkt tema Visa dolda filer + Show full path diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 951c57e1..24fea48f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -68,4 +68,5 @@ Settings Dark theme Show hidden files and directories + Show full path