Upgrade libs

This commit is contained in:
J-Jamet
2022-02-08 18:33:49 +01:00
parent 460726cadb
commit 6ceecbfd0f
10 changed files with 33 additions and 29 deletions

View File

@@ -106,7 +106,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "com.android.support:multidex:1.0.3"
implementation "androidx.appcompat:appcompat:$android_appcompat_version"
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
@@ -115,7 +115,7 @@ dependencies {
implementation 'androidx.media:media:1.4.3'
// Lifecycle - LiveData - ViewModel - Coroutines
implementation "androidx.core:core-ktx:$android_core_version"
implementation 'androidx.fragment:fragment-ktx:1.4.0'
implementation 'androidx.fragment:fragment-ktx:1.4.1'
implementation "com.google.android.material:material:$android_material_version"
// Token auto complete
// From sources until https://github.com/splitwise/TokenAutoComplete/pull/422 fixed

View File

@@ -41,12 +41,12 @@ class AutofillSettingsFragment : PreferenceFragmentCompat() {
}
}
override fun onDisplayPreferenceDialog(preference: Preference?) {
override fun onDisplayPreferenceDialog(preference: Preference) {
var otherDialogFragment = false
var dialogFragment: DialogFragment? = null
when (preference?.key) {
when (preference.key) {
getString(R.string.autofill_application_id_blocklist_key) -> {
dialogFragment = AutofillBlocklistAppIdPreferenceDialogFragmentCompat.newInstance(preference.key)
}

View File

@@ -34,13 +34,13 @@ class MagikeyboardSettingsFragment : PreferenceFragmentCompat() {
setPreferencesFromResource(R.xml.preferences_keyboard, rootKey)
}
override fun onDisplayPreferenceDialog(preference: Preference?) {
override fun onDisplayPreferenceDialog(preference: Preference) {
var otherDialogFragment = false
var dialogFragment: DialogFragment? = null
// Main Preferences
when (preference?.key) {
when (preference.key) {
getString(R.string.keyboard_entry_timeout_key) -> {
dialogFragment = DurationDialogFragmentCompat.newInstance(preference.key)
}

View File

@@ -437,9 +437,9 @@ class NestedAppSettingsFragment : NestedSettingsFragment() {
}
}
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
override fun onPreferenceTreeClick(preference: Preference): Boolean {
// To reload group when appearance settings are modified
when (preference?.key) {
when (preference.key) {
getString(R.string.setting_style_key),
getString(R.string.setting_style_brightness_key),
getString(R.string.setting_icon_pack_choose_key),
@@ -459,13 +459,13 @@ class NestedAppSettingsFragment : NestedSettingsFragment() {
return super.onPreferenceTreeClick(preference)
}
override fun onDisplayPreferenceDialog(preference: Preference?) {
override fun onDisplayPreferenceDialog(preference: Preference) {
var otherDialogFragment = false
var dialogFragment: DialogFragment? = null
// Main Preferences
when (preference?.key) {
when (preference.key) {
getString(R.string.app_timeout_key),
getString(R.string.clipboard_timeout_key),
getString(R.string.temp_advanced_unlock_timeout_key) -> {

View File

@@ -155,18 +155,22 @@ class NestedDatabaseSettingsFragment : NestedSettingsFragment(), DatabaseRetriev
// Database name
dbNamePref = findPreference(getString(R.string.database_name_key))
dbNamePref?.let { namePreference ->
if (database.allowName) {
dbNamePref?.summary = database.name
namePreference.summary = database.name
} else {
dbGeneralPrefCategory?.removePreference(dbNamePref)
dbGeneralPrefCategory?.removePreference(namePreference)
}
}
// Database description
dbDescriptionPref = findPreference(getString(R.string.database_description_key))
dbDescriptionPref?.let { descriptionPreference ->
if (database.allowDescription) {
dbDescriptionPref?.summary = database.description
} else {
dbGeneralPrefCategory?.removePreference(dbDescriptionPref)
dbGeneralPrefCategory?.removePreference(descriptionPreference)
}
}
// Database default username
@@ -355,7 +359,7 @@ class NestedDatabaseSettingsFragment : NestedSettingsFragment(), DatabaseRetriev
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
val view = super.onCreateView(inflater, container, savedInstanceState)
try {
@@ -565,13 +569,13 @@ class NestedDatabaseSettingsFragment : NestedSettingsFragment(), DatabaseRetriev
}
}
override fun onDisplayPreferenceDialog(preference: Preference?) {
override fun onDisplayPreferenceDialog(preference: Preference) {
var otherDialogFragment = false
var dialogFragment: DialogFragment? = null
// Main Preferences
when (preference?.key) {
when (preference.key) {
getString(R.string.database_name_key) -> {
dialogFragment = DatabaseNamePreferenceDialogFragmentCompat.newInstance(preference.key)
}
@@ -687,9 +691,9 @@ class NestedDatabaseSettingsFragment : NestedSettingsFragment(), DatabaseRetriev
}
}
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
override fun onPreferenceTreeClick(preference: Preference): Boolean {
// To reload group when database settings are modified
when (preference?.key) {
when (preference.key) {
getString(R.string.database_name_key),
getString(R.string.database_description_key),
getString(R.string.database_default_username_key),

View File

@@ -61,9 +61,9 @@ class DurationDialogPreference @JvmOverloads constructor(context: Context,
}
}
override fun onGetDefaultValue(a: TypedArray?, index: Int): Any {
override fun onGetDefaultValue(a: TypedArray, index: Int): Any {
return try {
a?.getString(index)?.toLongOrNull() ?: mDuration
a.getString(index)?.toLongOrNull() ?: mDuration
} catch (e: Exception) {
mDuration
}

View File

@@ -35,7 +35,7 @@ open class InputKdfNumberPreference @JvmOverloads constructor(context: Context,
return R.layout.pref_dialog_input_numbers
}
override fun setSummary(summary: CharSequence) {
override fun setSummary(summary: CharSequence?) {
if (summary == UNKNOWN_VALUE_STRING) {
isEnabled = false
super.setSummary("")

View File

@@ -30,7 +30,7 @@ class InputKdfSizePreference @JvmOverloads constructor(context: Context,
defStyleRes: Int = defStyleAttr)
: InputKdfNumberPreference(context, attrs, defStyleAttr, defStyleRes) {
override fun setSummary(summary: CharSequence) {
override fun setSummary(summary: CharSequence?) {
if (summary == UNKNOWN_VALUE_STRING) {
super.setSummary(summary)
} else {

View File

@@ -34,7 +34,7 @@ open class InputNumberPreference @JvmOverloads constructor(context: Context,
return R.layout.pref_dialog_input_numbers
}
override fun setSummary(summary: CharSequence) {
override fun setSummary(summary: CharSequence?) {
if (summary == INFINITE_VALUE_STRING) {
super.setSummary("")
} else {

View File

@@ -30,7 +30,7 @@ open class InputSizePreference @JvmOverloads constructor(context: Context,
defStyleRes: Int = defStyleAttr)
: InputNumberPreference(context, attrs, defStyleAttr, defStyleRes) {
override fun setSummary(summary: CharSequence) {
override fun setSummary(summary: CharSequence?) {
var summaryString = summary
try {
val memorySize = summary.toString().toLong()