mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-29 13:27:46 +00:00
refactor(extension): remove PreferenceManager dependency for getting preferences
should help when using faked SharedPreferences Signed-off-by: SphericalKat <amolele@gmail.com>
This commit is contained in:
parent
f377510afb
commit
bd09190786
@ -29,6 +29,7 @@ import com.github.ajalt.timberkt.d
|
|||||||
import com.github.michaelbull.result.Ok
|
import com.github.michaelbull.result.Ok
|
||||||
import com.github.michaelbull.result.Result
|
import com.github.michaelbull.result.Result
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
import dev.msfjarvis.aps.BuildConfig
|
||||||
import dev.msfjarvis.aps.R
|
import dev.msfjarvis.aps.R
|
||||||
import dev.msfjarvis.aps.data.repo.PasswordRepository
|
import dev.msfjarvis.aps.data.repo.PasswordRepository
|
||||||
import dev.msfjarvis.aps.util.git.operation.GitOperation
|
import dev.msfjarvis.aps.util.git.operation.GitOperation
|
||||||
@ -85,7 +86,7 @@ val Context.keyguardManager: KeyguardManager
|
|||||||
|
|
||||||
/** Get the default [SharedPreferences] instance */
|
/** Get the default [SharedPreferences] instance */
|
||||||
val Context.sharedPrefs: SharedPreferences
|
val Context.sharedPrefs: SharedPreferences
|
||||||
get() = PreferenceManager.getDefaultSharedPreferences(applicationContext)
|
get() = getSharedPreferences("${BuildConfig.APPLICATION_ID}_preferences", 0)
|
||||||
|
|
||||||
/** Resolve [attr] from the [Context]'s theme */
|
/** Resolve [attr] from the [Context]'s theme */
|
||||||
fun Context.resolveAttribute(attr: Int): Int {
|
fun Context.resolveAttribute(attr: Int): Int {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user