Skip to content

Commit 0ec24fd

Browse files
committed
add a setting for keeping last-modified field at copy/move/rename
1 parent 4019941 commit 0ec24fd

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ android {
3737
}
3838

3939
dependencies {
40-
compile 'com.simplemobiletools:commons:2.34.1'
40+
compile 'com.simplemobiletools:commons:2.34.2'
4141
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
4242
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
4343

app/src/main/kotlin/com/simplemobiletools/filemanager/activities/SettingsActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class SettingsActivity : SimpleActivity() {
2727
setupManageFavorites()
2828
setupShowHidden()
2929
setupPasswordProtection()
30+
setupKeepLastModified()
3031
setupEnableRootAccess()
3132
updateTextColors(settings_holder)
3233
}
@@ -81,6 +82,14 @@ class SettingsActivity : SimpleActivity() {
8182
}
8283
}
8384

85+
private fun setupKeepLastModified() {
86+
settings_keep_last_modified.isChecked = config.keepLastModified
87+
settings_keep_last_modified_holder.setOnClickListener {
88+
settings_keep_last_modified.toggle()
89+
config.keepLastModified = settings_keep_last_modified.isChecked
90+
}
91+
}
92+
8493
private fun setupEnableRootAccess() {
8594
settings_enable_root_access_holder.beVisibleIf(config.isRootAvailable)
8695
settings_enable_root_access.isChecked = config.enableRootAccess

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,26 @@
8989

9090
</RelativeLayout>
9191

92+
<RelativeLayout
93+
android:id="@+id/settings_keep_last_modified_holder"
94+
android:layout_width="match_parent"
95+
android:layout_height="wrap_content"
96+
android:layout_marginTop="@dimen/medium_margin"
97+
android:background="?attr/selectableItemBackground"
98+
android:padding="@dimen/activity_margin">
99+
100+
<com.simplemobiletools.commons.views.MySwitchCompat
101+
android:id="@+id/settings_keep_last_modified"
102+
android:layout_width="match_parent"
103+
android:layout_height="wrap_content"
104+
android:background="@null"
105+
android:clickable="false"
106+
android:paddingLeft="@dimen/medium_margin"
107+
android:paddingStart="@dimen/medium_margin"
108+
android:text="@string/keep_last_modified"/>
109+
110+
</RelativeLayout>
111+
92112
<RelativeLayout
93113
android:id="@+id/settings_enable_root_access_holder"
94114
android:layout_width="match_parent"

0 commit comments

Comments
 (0)