Replace deprecated PreferenceManager with androidx version.

This commit is contained in:
onurays 2020-03-26 15:56:33 +03:00
parent 12429d8091
commit f7cbc01023
12 changed files with 24 additions and 8 deletions

View File

@ -18,7 +18,7 @@ Translations 🗣:
-
SDK API changes ⚠️:
-
- Increase targetSdkVersion to 29
Build 🧱:
-

View File

@ -29,3 +29,7 @@ annotation class SessionCacheDirectory
@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class CacheDirectory
@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class ExternalFilesDirectory

View File

@ -56,6 +56,9 @@ internal interface MatrixComponent {
@CacheDirectory
fun cacheDir(): File
@ExternalFilesDirectory
fun externalFilesDir(): File?
fun olmManager(): OlmManager
fun taskExecutor(): TaskExecutor

View File

@ -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

View File

@ -14,6 +14,8 @@
* limitations under the License.
*/
@file:Suppress("DEPRECATION")
package im.vector.matrix.android.internal.network
import android.content.BroadcastReceiver

View File

@ -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

View File

@ -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

View File

@ -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()
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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