diff options
author | SphericalKat <amolele@gmail.com> | 2021-05-17 14:21:53 +0530 |
---|---|---|
committer | SphericalKat <amolele@gmail.com> | 2021-05-17 14:21:53 +0530 |
commit | bd09190786d85e915d11ea253eb62764941f4e8e (patch) | |
tree | 3161e8ebce87502a5fcc3eb01afec898bd4a02d4 /app | |
parent | f377510afbd5056f32f954f74411ee3b30bae4bf (diff) |
refactor(extension): remove PreferenceManager dependency for getting preferences
should help when using faked SharedPreferences
Signed-off-by: SphericalKat <amolele@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/dev/msfjarvis/aps/util/extensions/AndroidExtensions.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/util/extensions/AndroidExtensions.kt b/app/src/main/java/dev/msfjarvis/aps/util/extensions/AndroidExtensions.kt index 21cc30bc..0c43d6cd 100644 --- a/app/src/main/java/dev/msfjarvis/aps/util/extensions/AndroidExtensions.kt +++ b/app/src/main/java/dev/msfjarvis/aps/util/extensions/AndroidExtensions.kt @@ -29,6 +29,7 @@ import com.github.ajalt.timberkt.d import com.github.michaelbull.result.Ok import com.github.michaelbull.result.Result import com.google.android.material.snackbar.Snackbar +import dev.msfjarvis.aps.BuildConfig import dev.msfjarvis.aps.R import dev.msfjarvis.aps.data.repo.PasswordRepository import dev.msfjarvis.aps.util.git.operation.GitOperation @@ -85,7 +86,7 @@ val Context.keyguardManager: KeyguardManager /** Get the default [SharedPreferences] instance */ val Context.sharedPrefs: SharedPreferences - get() = PreferenceManager.getDefaultSharedPreferences(applicationContext) + get() = getSharedPreferences("${BuildConfig.APPLICATION_ID}_preferences", 0) /** Resolve [attr] from the [Context]'s theme */ fun Context.resolveAttribute(attr: Int): Int { |