Updated on 2026-08-14
This commit is contained in:
parent
f601005fc9
commit
0dc09b91b2
3 changed files with 26 additions and 12 deletions
|
|
@ -74,7 +74,7 @@ internal fun TokensListScreen(stateHolder: TokensListStateHolder, modifier: Modi
|
|||
val tokens = stateHolder.tokens.collectAsLazyPagingItems()
|
||||
|
||||
TokensListContent(
|
||||
isDifferentAddressesBlockVisible = stateHolder.isDifferentAddressesBlockVisible && !stateHolder.isLoading,
|
||||
isDifferentAddressesBlockVisible = stateHolder.isDifferentAddressesBlockVisible,
|
||||
tokens = tokens,
|
||||
scaffoldPadding = scaffoldPadding,
|
||||
bottomMarginDp = floatingButtonHeight,
|
||||
|
|
@ -125,8 +125,11 @@ private fun TokensListContent(
|
|||
state = state,
|
||||
contentPadding = PaddingValues(bottom = bottomMarginDp),
|
||||
) {
|
||||
if (isDifferentAddressesBlockVisible) {
|
||||
item { DifferentAddressesWarning() }
|
||||
item(
|
||||
key = "DifferentAddressesWarning$isDifferentAddressesBlockVisible",
|
||||
contentType = "DifferentAddressesWarning$isDifferentAddressesBlockVisible",
|
||||
) {
|
||||
if (isDifferentAddressesBlockVisible) DifferentAddressesWarning()
|
||||
}
|
||||
|
||||
tokens.itemKey(TokenItemState::composedId)
|
||||
|
|
|
|||
|
|
@ -111,8 +111,8 @@
|
|||
|
||||
<FrameLayout
|
||||
android:id="@+id/imv_activation_success"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/imv_card_background"
|
||||
|
|
@ -121,23 +121,23 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/imv_card_background">
|
||||
|
||||
<View
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/shape_success_circle"
|
||||
android:backgroundTint="@color/background_primary" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/imv_success_middle"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/img_onboarding_success" />
|
||||
|
||||
<View
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:alpha="0.2"
|
||||
android:background="@drawable/shape_success_circle"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.tangem.feature.wallet.presentation.wallet.ui
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.ContextWrapper
|
||||
import android.widget.Toast
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.material3.SnackbarHostState
|
||||
|
|
@ -57,7 +59,7 @@ internal fun WalletEventEffect(
|
|||
.addOnCompleteListener {
|
||||
handleOnCompleteRequestTask(
|
||||
reviewManager = reviewManager,
|
||||
activity = context as? Activity ?: return@addOnCompleteListener,
|
||||
activity = context.findActivity(),
|
||||
task = it,
|
||||
onDismissClick = value.onDismissClick,
|
||||
)
|
||||
|
|
@ -69,6 +71,15 @@ internal fun WalletEventEffect(
|
|||
)
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
private fun handleOnCompleteRequestTask(
|
||||
reviewManager: ReviewManager,
|
||||
activity: Activity,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue