Updated on 2026-08-14
This commit is contained in:
parent
faafa2724a
commit
04b7287332
45 changed files with 1597 additions and 96 deletions
|
|
@ -2,11 +2,11 @@ package com.tangem.feature.wallet.presentation.wallet.ui.utils
|
|||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.ContextWrapper
|
||||
import com.google.android.gms.tasks.Task
|
||||
import com.google.android.play.core.review.ReviewInfo
|
||||
import com.google.android.play.core.review.ReviewManager
|
||||
import com.google.android.play.core.review.ReviewManagerFactory
|
||||
import com.tangem.core.ui.utils.findActivity
|
||||
import timber.log.Timber
|
||||
|
||||
internal object ReviewManagerRequester {
|
||||
|
|
@ -44,13 +44,4 @@ internal object ReviewManagerRequester {
|
|||
Timber.e(task.exception)
|
||||
}
|
||||
}
|
||||
|
||||
private fun Context.findActivity(): Activity {
|
||||
var context = this
|
||||
while (context is ContextWrapper) {
|
||||
if (context is Activity) return context
|
||||
context = context.baseContext
|
||||
}
|
||||
error("Permissions should be called in the context of an Activity")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue