Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianDevel committed Feb 6, 2024
1 parent 0dc59aa commit c588718
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Stores/src/main/java/StoresLocalSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StoresLocalSettings private constructor(context: Context) : SharedValues {
override val sharedPreferences = context.applicationContext.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE)!!

var isUserWantingUpdates by sharedValue("isUserWantingUpdatesKey", true)
var hasAppUpdateDownloaded by sharedValue("hasAppUpdateDownloaded", false)
var hasAppUpdateDownloaded by sharedValue("hasAppUpdateDownloadedKey", false)
var appUpdateLaunches by sharedValue("appUpdateLaunchesKey", 0)
var appReviewLaunches by sharedValue("appReviewLaunchesKey", DEFAULT_APP_REVIEW_LAUNCHES)
var showAppReviewDialog by sharedValue("showAppReviewDialogKey", true)
Expand All @@ -40,10 +40,10 @@ class StoresLocalSettings private constructor(context: Context) : SharedValues {

companion object {

private const val SHARED_PREFS_NAME = "StoresLocalSettingsSharedPref"

const val DEFAULT_APP_REVIEW_LAUNCHES = 50

private const val SHARED_PREFS_NAME = "StoresLocalSettingsSharedPref"

@Volatile
private var INSTANCE: StoresLocalSettings? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class InAppUpdateManager(

private val appUpdateManager = AppUpdateManagerFactory.create(activity)
// Result of in app update's bottomSheet user choice
private var inAppUpdateResultLauncher: ActivityResultLauncher<IntentSenderRequest> = activity.registerForActivityResult(
private val inAppUpdateResultLauncher: ActivityResultLauncher<IntentSenderRequest> = activity.registerForActivityResult(
ActivityResultContracts.StartIntentSenderForResult()
) { result ->
val isUserWantingUpdate = result.resultCode == AppCompatActivity.RESULT_OK
Expand Down Expand Up @@ -118,7 +118,7 @@ class InAppUpdateManager(
}

private fun observeAppUpdateDownload() {
viewModel.canInstallUpdate.observe(activity) { isUploadDownloaded -> onInAppUpdateUiChange?.invoke(isUploadDownloaded) }
viewModel.canInstallUpdate.observe(activity) { isUpdateDownloaded -> onInAppUpdateUiChange?.invoke(isUpdateDownloaded) }
}

private fun checkStalledUpdate(): Unit = with(appUpdateManager) {
Expand Down

0 comments on commit c588718

Please sign in to comment.