Updated on 2026-08-14
This commit is contained in:
parent
20eba62956
commit
e92074bbb0
21 changed files with 36 additions and 75 deletions
|
|
@ -73,9 +73,8 @@ private fun TokenReceiveBottomSheetContent(content: TokenReceiveBottomSheetConfi
|
|||
)
|
||||
|
||||
Buttons(
|
||||
address = selectedAddress.value,
|
||||
snackbarHostState = snackbarHostState,
|
||||
onShareClick = content.onShareClick,
|
||||
onShareClick = { content.onShareClick(selectedAddress.value) },
|
||||
onCopyClick = { content.onCopyClick(selectedAddress.value) },
|
||||
)
|
||||
}
|
||||
|
|
@ -227,7 +226,6 @@ private fun getName(content: TokenReceiveBottomSheetConfig, index: Int): String
|
|||
|
||||
@Composable
|
||||
private fun Buttons(
|
||||
address: String,
|
||||
snackbarHostState: SnackbarHostState,
|
||||
onShareClick: () -> Unit,
|
||||
onCopyClick: () -> Unit,
|
||||
|
|
@ -264,10 +262,9 @@ private fun Buttons(
|
|||
text = stringResourceSafe(id = R.string.common_share),
|
||||
iconResId = R.drawable.ic_share_24,
|
||||
onClick = {
|
||||
onShareClick()
|
||||
|
||||
hapticFeedback.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
context.shareText(address)
|
||||
|
||||
onShareClick()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@ data class TokenReceiveBottomSheetConfig(
|
|||
val addresses: ImmutableList<AddressModel>,
|
||||
val showMemoDisclaimer: Boolean,
|
||||
val onCopyClick: (String) -> Unit,
|
||||
val onShareClick: () -> Unit,
|
||||
val onShareClick: (String) -> Unit,
|
||||
) : TangemBottomSheetConfigContent
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.tangem.core.ui.extensions
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.core.content.ContextCompat
|
||||
|
||||
fun Context.shareText(text: String) {
|
||||
val sendIntent: Intent = Intent().apply {
|
||||
action = Intent.ACTION_SEND
|
||||
putExtra(Intent.EXTRA_TEXT, text)
|
||||
type = "text/plain"
|
||||
}
|
||||
val shareIntent = Intent.createChooser(sendIntent, null)
|
||||
ContextCompat.startActivity(this, shareIntent, null)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue