mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +03:00
Replace deprecated PreferenceManager with androidx version.
This commit is contained in:
parent
12429d8091
commit
f7cbc01023
12 changed files with 24 additions and 8 deletions
|
@ -18,7 +18,7 @@ Translations 🗣:
|
|||
-
|
||||
|
||||
SDK API changes ⚠️:
|
||||
-
|
||||
- Increase targetSdkVersion to 29
|
||||
|
||||
Build 🧱:
|
||||
-
|
||||
|
|
|
@ -29,3 +29,7 @@ annotation class SessionCacheDirectory
|
|||
@Qualifier
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class CacheDirectory
|
||||
|
||||
@Qualifier
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class ExternalFilesDirectory
|
||||
|
|
|
@ -56,6 +56,9 @@ internal interface MatrixComponent {
|
|||
@CacheDirectory
|
||||
fun cacheDir(): File
|
||||
|
||||
@ExternalFilesDirectory
|
||||
fun externalFilesDir(): File?
|
||||
|
||||
fun olmManager(): OlmManager
|
||||
|
||||
fun taskExecutor(): TaskExecutor
|
||||
|
|
|
@ -57,6 +57,13 @@ internal object MatrixModule {
|
|||
return context.cacheDir
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@Provides
|
||||
@ExternalFilesDirectory
|
||||
fun providesExternalFilesDir(context: Context): File? {
|
||||
return context.getExternalFilesDir(null)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@Provides
|
||||
@MatrixScope
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package im.vector.matrix.android.internal.network
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
|
|
|
@ -21,7 +21,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.SharedPreferences
|
||||
import android.preference.PreferenceManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.core.content.edit
|
||||
import im.vector.riotx.core.utils.lsFiles
|
||||
import timber.log.Timber
|
||||
|
|
|
@ -19,7 +19,7 @@ package im.vector.riotx.push.fcm
|
|||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.preference.PreferenceManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import android.widget.Toast
|
||||
import com.google.android.gms.common.ConnectionResult
|
||||
import com.google.android.gms.common.GoogleApiAvailability
|
||||
|
|
|
@ -171,7 +171,7 @@ class VectorApplication : Application(), HasVectorInjector, MatrixConfiguration.
|
|||
MultiDex.install(this)
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration?) {
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
vectorConfiguration.onConfigurationChanged()
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package im.vector.riotx.core.ui.views
|
||||
|
||||
import android.content.Context
|
||||
import android.preference.PreferenceManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
|
|
@ -20,7 +20,7 @@ import android.content.Context
|
|||
import android.media.Ringtone
|
||||
import android.media.RingtoneManager
|
||||
import android.net.Uri
|
||||
import android.preference.PreferenceManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.core.content.edit
|
||||
import im.vector.riotx.features.settings.VectorPreferences
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package im.vector.riotx.features.disclaimer
|
||||
|
||||
import android.app.Activity
|
||||
import android.preference.PreferenceManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
|
|
|
@ -19,7 +19,7 @@ package im.vector.riotx.features.settings
|
|||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.os.Build
|
||||
import android.preference.PreferenceManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.core.content.edit
|
||||
import im.vector.riotx.BuildConfig
|
||||
import im.vector.riotx.R
|
||||
|
|
Loading…
Reference in a new issue