Skip to content

Commit 252803e

Browse files
committed
add a switch for showing full folder paths
1 parent 7416c22 commit 252803e

File tree

9 files changed

+54
-2
lines changed

9 files changed

+54
-2
lines changed

app/src/main/java/com/simplemobiletools/filemanager/Config.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,12 @@ public boolean getShowHidden() {
3737
public void setShowHidden(boolean show) {
3838
mPrefs.edit().putBoolean(Constants.SHOW_HIDDEN, show).apply();
3939
}
40+
41+
public boolean getShowFullPath() {
42+
return mPrefs.getBoolean(Constants.SHOW_FULL_PATH, false);
43+
}
44+
45+
public void setShowFullPath(boolean show) {
46+
mPrefs.edit().putBoolean(Constants.SHOW_FULL_PATH, show).apply();
47+
}
4048
}

app/src/main/java/com/simplemobiletools/filemanager/Constants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ public class Constants {
88
public static final String IS_FIRST_RUN = "is_first_run";
99
public static final String IS_DARK_THEME = "is_dark_theme";
1010
public static final String SHOW_HIDDEN = "show_hidden";
11+
public static final String SHOW_FULL_PATH = "show_full_path";
1112
}

app/src/main/java/com/simplemobiletools/filemanager/activities/SettingsActivity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
public class SettingsActivity extends SimpleActivity {
1515
@BindView(R.id.settings_dark_theme) SwitchCompat mDarkThemeSwitch;
1616
@BindView(R.id.settings_show_hidden) SwitchCompat mShowHiddenSwitch;
17+
@BindView(R.id.settings_show_full_path) SwitchCompat mShowFullPathSwitch;
1718

1819
private static Config mConfig;
1920

@@ -26,6 +27,7 @@ protected void onCreate(Bundle savedInstanceState) {
2627

2728
setupDarkTheme();
2829
setupShowHidden();
30+
setupShowFullPath();
2931
}
3032

3133
private void setupDarkTheme() {
@@ -36,6 +38,10 @@ private void setupShowHidden() {
3638
mShowHiddenSwitch.setChecked(mConfig.getShowHidden());
3739
}
3840

41+
private void setupShowFullPath() {
42+
mShowFullPathSwitch.setChecked(mConfig.getShowFullPath());
43+
}
44+
3945
@OnClick(R.id.settings_dark_theme_holder)
4046
public void handleDarkTheme() {
4147
mDarkThemeSwitch.setChecked(!mDarkThemeSwitch.isChecked());
@@ -49,6 +55,12 @@ public void handleShowHidden() {
4955
mConfig.setShowHidden(mShowHiddenSwitch.isChecked());
5056
}
5157

58+
@OnClick(R.id.settings_show_full_path_holder)
59+
public void handleShowFullPath() {
60+
mShowFullPathSwitch.setChecked(!mShowFullPathSwitch.isChecked());
61+
mConfig.setShowFullPath(mShowFullPathSwitch.isChecked());
62+
}
63+
5264
private void restartActivity() {
5365
TaskStackBuilder.create(getApplicationContext()).addNextIntentWithParentStack(getIntent()).startActivities();
5466
}

app/src/main/res/layout/activity_settings.xml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
android:layout_width="match_parent"
1717
android:layout_height="wrap_content"
1818
android:layout_marginTop="@dimen/settings_padding"
19-
android:background="?android:attr/selectableItemBackground"
19+
android:background="?attr/selectableItemBackground"
2020
android:padding="@dimen/activity_margin">
2121

2222
<TextView
@@ -42,7 +42,7 @@
4242
android:layout_width="match_parent"
4343
android:layout_height="wrap_content"
4444
android:layout_marginTop="@dimen/settings_padding"
45-
android:background="?android:attr/selectableItemBackground"
45+
android:background="?attr/selectableItemBackground"
4646
android:padding="@dimen/activity_margin">
4747

4848
<TextView
@@ -62,5 +62,31 @@
6262
android:clickable="false"/>
6363

6464
</RelativeLayout>
65+
66+
<RelativeLayout
67+
android:id="@+id/settings_show_full_path_holder"
68+
android:layout_width="match_parent"
69+
android:layout_height="wrap_content"
70+
android:layout_marginTop="@dimen/settings_padding"
71+
android:background="?attr/selectableItemBackground"
72+
android:padding="@dimen/activity_margin">
73+
74+
<TextView
75+
android:id="@+id/settings_show_full_path_label"
76+
android:layout_width="wrap_content"
77+
android:layout_height="wrap_content"
78+
android:layout_centerVertical="true"
79+
android:paddingLeft="@dimen/settings_padding"
80+
android:text="@string/show_full_path"/>
81+
82+
<android.support.v7.widget.SwitchCompat
83+
android:id="@+id/settings_show_full_path"
84+
android:layout_width="wrap_content"
85+
android:layout_height="wrap_content"
86+
android:layout_alignParentRight="true"
87+
android:background="@null"
88+
android:clickable="false"/>
89+
90+
</RelativeLayout>
6591
</LinearLayout>
6692
</ScrollView>

app/src/main/res/values-de/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@
6565
<string name="settings">Einstellungen</string>
6666
<string name="dark_theme">Dunkles Thema</string>
6767
<string name="show_hidden">Zeige versteckte Dateien und Ordner</string>
68+
<string name="show_full_path">Show full path</string>
6869
</resources>

app/src/main/res/values-it/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@
6565
<string name="settings">Impostazioni</string>
6666
<string name="dark_theme">Tema scuro</string>
6767
<string name="show_hidden">Mostra file e cartelle nascosti</string>
68+
<string name="show_full_path">Show full path</string>
6869
</resources>

app/src/main/res/values-ja/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@
6565
<string name="settings">設定</string>
6666
<string name="dark_theme">ダークテーマ</string>
6767
<string name="show_hidden">非表示のファイルとディレクトリーを表示する</string>
68+
<string name="show_full_path">Show full path</string>
6869
</resources>

app/src/main/res/values-sv/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@
6565
<string name="settings">Settings</string>
6666
<string name="dark_theme">Mörkt tema</string>
6767
<string name="show_hidden">Visa dolda filer</string>
68+
<string name="show_full_path">Show full path</string>
6869
</resources>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@
6868
<string name="settings">Settings</string>
6969
<string name="dark_theme">Dark theme</string>
7070
<string name="show_hidden">Show hidden files and directories</string>
71+
<string name="show_full_path">Show full path</string>
7172
</resources>

0 commit comments

Comments
 (0)