Loading commons/src/main/kotlin/com/simplemobiletools/commons/helpers/AlphanumericComparator.kt +2 −4 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class AlphanumericComparator { result = thisChunkLength - thatChunk.length // If equal, the first different number counts. if (result == 0) { for (i in 0..thisChunkLength - 1) { for (i in 0 until thisChunkLength) { result = thisChunk[i] - thatChunk[i] if (result != 0) { return result Loading Loading @@ -71,7 +71,5 @@ class AlphanumericComparator { return chunk.toString() } private fun isDigit(ch: Char): Boolean { return ch in '0'..'9' } private fun isDigit(ch: Char) = ch in '0'..'9' } commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt +13 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,19 @@ open class BaseConfig(val context: Context) { get() = prefs.getInt(APP_PROTECTION_TYPE, PROTECTION_PATTERN) set(appProtectionType) = prefs.edit().putInt(APP_PROTECTION_TYPE, appProtectionType).apply() // protection about deleting files/folders var deletePasswordProtectionOn: Boolean get() = prefs.getBoolean(DELETE_PASSWORD_PROTECTION, false) set(deletePasswordProtectionOn) = prefs.edit().putBoolean(DELETE_PASSWORD_PROTECTION, deletePasswordProtectionOn).apply() var deletePasswordHash: String get() = prefs.getString(DELETE_PASSWORD_HASH, "") set(deletePasswordHash) = prefs.edit().putString(DELETE_PASSWORD_HASH, deletePasswordHash).apply() var deleteProtectionType: Int get() = prefs.getInt(DELETE_PROTECTION_TYPE, PROTECTION_PATTERN) set(deleteProtectionType) = prefs.edit().putInt(DELETE_PROTECTION_TYPE, deleteProtectionType).apply() var keepLastModified: Boolean get() = prefs.getBoolean(KEEP_LAST_MODIFIED, true) set(keepLastModified) = prefs.edit().putBoolean(KEEP_LAST_MODIFIED, keepLastModified).apply() Loading commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt +3 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,9 @@ const val PROTECTION_TYPE = "protection_type" const val APP_PASSWORD_PROTECTION = "app_password_protection" const val APP_PASSWORD_HASH = "app_password_hash" const val APP_PROTECTION_TYPE = "app_protection_type" const val DELETE_PASSWORD_PROTECTION = "delete_password_protection" const val DELETE_PASSWORD_HASH = "delete_password_hash" const val DELETE_PROTECTION_TYPE = "delete_protection_type" const val KEEP_LAST_MODIFIED = "keep_last_modified" const val USE_ENGLISH = "use_english" const val WAS_USE_ENGLISH_TOGGLED = "was_use_english_toggled" Loading Loading
commons/src/main/kotlin/com/simplemobiletools/commons/helpers/AlphanumericComparator.kt +2 −4 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class AlphanumericComparator { result = thisChunkLength - thatChunk.length // If equal, the first different number counts. if (result == 0) { for (i in 0..thisChunkLength - 1) { for (i in 0 until thisChunkLength) { result = thisChunk[i] - thatChunk[i] if (result != 0) { return result Loading Loading @@ -71,7 +71,5 @@ class AlphanumericComparator { return chunk.toString() } private fun isDigit(ch: Char): Boolean { return ch in '0'..'9' } private fun isDigit(ch: Char) = ch in '0'..'9' }
commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt +13 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,19 @@ open class BaseConfig(val context: Context) { get() = prefs.getInt(APP_PROTECTION_TYPE, PROTECTION_PATTERN) set(appProtectionType) = prefs.edit().putInt(APP_PROTECTION_TYPE, appProtectionType).apply() // protection about deleting files/folders var deletePasswordProtectionOn: Boolean get() = prefs.getBoolean(DELETE_PASSWORD_PROTECTION, false) set(deletePasswordProtectionOn) = prefs.edit().putBoolean(DELETE_PASSWORD_PROTECTION, deletePasswordProtectionOn).apply() var deletePasswordHash: String get() = prefs.getString(DELETE_PASSWORD_HASH, "") set(deletePasswordHash) = prefs.edit().putString(DELETE_PASSWORD_HASH, deletePasswordHash).apply() var deleteProtectionType: Int get() = prefs.getInt(DELETE_PROTECTION_TYPE, PROTECTION_PATTERN) set(deleteProtectionType) = prefs.edit().putInt(DELETE_PROTECTION_TYPE, deleteProtectionType).apply() var keepLastModified: Boolean get() = prefs.getBoolean(KEEP_LAST_MODIFIED, true) set(keepLastModified) = prefs.edit().putBoolean(KEEP_LAST_MODIFIED, keepLastModified).apply() Loading
commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt +3 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,9 @@ const val PROTECTION_TYPE = "protection_type" const val APP_PASSWORD_PROTECTION = "app_password_protection" const val APP_PASSWORD_HASH = "app_password_hash" const val APP_PROTECTION_TYPE = "app_protection_type" const val DELETE_PASSWORD_PROTECTION = "delete_password_protection" const val DELETE_PASSWORD_HASH = "delete_password_hash" const val DELETE_PROTECTION_TYPE = "delete_protection_type" const val KEEP_LAST_MODIFIED = "keep_last_modified" const val USE_ENGLISH = "use_english" const val WAS_USE_ENGLISH_TOGGLED = "was_use_english_toggled" Loading