Moved shared config to commons
This commit is contained in:
parent
48fa97f759
commit
8895d70e4f
2 changed files with 22 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
package com.simplemobiletools.commons.helpers
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import android.text.format.DateFormat
|
||||
import com.simplemobiletools.commons.R
|
||||
import com.simplemobiletools.commons.extensions.getInternalStoragePath
|
||||
|
@ -556,6 +557,22 @@ open class BaseConfig(val context: Context) {
|
|||
|
||||
var contactsGridColumnCnt: Int
|
||||
get() = prefs.getInt(CONTACTS_GRID_COLUMN_COUNT, CONTACTS_GRID_DEFAULT_COLUMNS_COUNT)
|
||||
set(gridLayoutSpanCount) = prefs.edit().putInt(CONTACTS_GRID_COLUMN_COUNT, gridLayoutSpanCount).apply()
|
||||
set(contactsGridColumnCnt) = prefs.edit().putInt(CONTACTS_GRID_COLUMN_COUNT, contactsGridColumnCnt).apply()
|
||||
|
||||
var autoBackup: Boolean
|
||||
get() = prefs.getBoolean(AUTO_BACKUP, false)
|
||||
set(autoBackup) = prefs.edit().putBoolean(AUTO_BACKUP, autoBackup).apply()
|
||||
|
||||
var autoBackupFolder: String
|
||||
get() = prefs.getString(AUTO_BACKUP_FOLDER, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).absolutePath)!!
|
||||
set(autoBackupFolder) = prefs.edit().putString(AUTO_BACKUP_FOLDER, autoBackupFolder).apply()
|
||||
|
||||
var autoBackupFilename: String
|
||||
get() = prefs.getString(AUTO_BACKUP_FILENAME, "")!!
|
||||
set(autoBackupFilename) = prefs.edit().putString(AUTO_BACKUP_FILENAME, autoBackupFilename).apply()
|
||||
|
||||
var lastAutoBackupTime: Long
|
||||
get() = prefs.getLong(LAST_AUTO_BACKUP_TIME, 0L)
|
||||
set(lastAutoBackupTime) = prefs.edit().putLong(LAST_AUTO_BACKUP_TIME, lastAutoBackupTime).apply()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,6 +187,10 @@ const val FAVORITES_CONTACTS_ORDER = "favorites_contacts_order"
|
|||
const val FAVORITES_CUSTOM_ORDER_SELECTED = "favorites_custom_order_selected"
|
||||
const val VIEW_TYPE = "view_type"
|
||||
const val CONTACTS_GRID_COLUMN_COUNT = "favourites_column_count"
|
||||
const val AUTO_BACKUP = "auto_backup"
|
||||
const val AUTO_BACKUP_FOLDER = "auto_backup_folder"
|
||||
const val AUTO_BACKUP_FILENAME = "auto_backup_filename"
|
||||
const val LAST_AUTO_BACKUP_TIME = "last_auto_backup_time"
|
||||
|
||||
// contact grid view constants
|
||||
const val CONTACTS_GRID_DEFAULT_COLUMNS_COUNT = 3
|
||||
|
|
Loading…
Reference in a new issue