Updated on 2026-08-14
This commit is contained in:
parent
768b44f44f
commit
e4039b220c
10 changed files with 64 additions and 22 deletions
|
|
@ -0,0 +1,24 @@
|
|||
package com.tangem.tap.common.share
|
||||
|
||||
import android.content.Intent
|
||||
import com.tangem.core.navigation.share.ShareManager
|
||||
import com.tangem.tap.foregroundActivityObserver
|
||||
import com.tangem.tap.withForegroundActivity
|
||||
|
||||
internal val shareManager = IntentShareManager
|
||||
|
||||
internal object IntentShareManager : ShareManager {
|
||||
|
||||
override fun shareText(text: String) {
|
||||
foregroundActivityObserver.withForegroundActivity { activity ->
|
||||
val sendIntent: Intent = Intent().apply {
|
||||
action = Intent.ACTION_SEND
|
||||
putExtra(Intent.EXTRA_TEXT, text)
|
||||
type = "text/plain"
|
||||
}
|
||||
val shareIntent = Intent.createChooser(sendIntent, null)
|
||||
|
||||
activity.startActivity(shareIntent)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue