Updated on 2026-08-14

This commit is contained in:
Tangem 2020-04-23 13:20:46 +03:00
parent 5105528ddc
commit 0131e08b68
201 changed files with 600 additions and 693 deletions

View file

@ -0,0 +1,22 @@
package com.tangem.devkit.extensions
import android.content.Intent
import androidx.activity.ComponentActivity
import androidx.fragment.app.Fragment
/**
[REDACTED_AUTHOR]
*/
fun Fragment.shareText(text: String) {
requireActivity().shareText(text)
}
fun ComponentActivity.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)
startActivity(shareIntent)
}