add a setting for keeping last-modified field at copy/move/rename

This commit is contained in:
tibbi 2017-10-29 22:23:28 +01:00
parent 4019941363
commit 0ec24fd67b
3 changed files with 30 additions and 1 deletions

View File

@ -37,7 +37,7 @@ android {
}
dependencies {
compile 'com.simplemobiletools:commons:2.34.1'
compile 'com.simplemobiletools:commons:2.34.2'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

View File

@ -27,6 +27,7 @@ class SettingsActivity : SimpleActivity() {
setupManageFavorites()
setupShowHidden()
setupPasswordProtection()
setupKeepLastModified()
setupEnableRootAccess()
updateTextColors(settings_holder)
}
@ -81,6 +82,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupKeepLastModified() {
settings_keep_last_modified.isChecked = config.keepLastModified
settings_keep_last_modified_holder.setOnClickListener {
settings_keep_last_modified.toggle()
config.keepLastModified = settings_keep_last_modified.isChecked
}
}
private fun setupEnableRootAccess() {
settings_enable_root_access_holder.beVisibleIf(config.isRootAvailable)
settings_enable_root_access.isChecked = config.enableRootAccess

View File

@ -89,6 +89,26 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_keep_last_modified_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_keep_last_modified"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/keep_last_modified"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_enable_root_access_holder"
android:layout_width="match_parent"