Updated on 2026-08-14
This commit is contained in:
parent
494aa88d35
commit
aa059666ba
10 changed files with 96 additions and 51 deletions
|
|
@ -3,7 +3,6 @@ package com.tangem.data.source.preferences
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import androidx.core.content.edit
|
||||
import com.tangem.data.source.preferences.storage.DisclaimerPrefStorage
|
||||
import javax.inject.Inject
|
||||
|
||||
// 🔥FIXME: Only logic to work with preferences must be here, must be separated to repositories
|
||||
|
|
@ -11,14 +10,11 @@ import javax.inject.Inject
|
|||
@Deprecated("Create repository instead")
|
||||
class PreferencesDataSource @Inject internal constructor(applicationContext: Context) {
|
||||
|
||||
val disclaimerPrefStorage: DisclaimerPrefStorage
|
||||
|
||||
private val preferences: SharedPreferences =
|
||||
applicationContext.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE)
|
||||
|
||||
init {
|
||||
incrementLaunchCounter()
|
||||
disclaimerPrefStorage = DisclaimerPrefStorage(preferences)
|
||||
}
|
||||
|
||||
var shouldShowSaveUserWalletScreen: Boolean
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
package com.tangem.data.source.preferences.storage
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import androidx.core.content.edit
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
@Deprecated("Create repository instead")
|
||||
class DisclaimerPrefStorage internal constructor(
|
||||
private val preferences: SharedPreferences,
|
||||
) {
|
||||
|
||||
fun accept(disclaimerKey: String) {
|
||||
preferences.edit { putBoolean(disclaimerKey, true) }
|
||||
}
|
||||
|
||||
fun isAccepted(disclaimerKey: String): Boolean {
|
||||
return preferences.getBoolean(disclaimerKey, false)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue