mirror of
https://github.com/Corewala/Buran
synced 2025-03-15 08:29:15 +00:00
Added handler for sharing local links
This commit is contained in:
parent
959d42e335
commit
20623fc4aa
1 changed files with 8 additions and 1 deletions
|
@ -71,9 +71,16 @@ class GemActivity : AppCompatActivity() {
|
|||
|
||||
private val onLink: (link: URI, longTap: Boolean, adapterPosition: Int) -> Unit = { uri, longTap, position: Int ->
|
||||
if(longTap){
|
||||
var fullUri = uri.toString()
|
||||
if(uri.toString().first() == '/'){
|
||||
if (omniTerm.getCurrent().last() == '/'){
|
||||
fullUri = fullUri.drop(1)
|
||||
}
|
||||
fullUri = omniTerm.getCurrent() + fullUri
|
||||
}
|
||||
Intent().apply {
|
||||
action = Intent.ACTION_SEND
|
||||
putExtra(Intent.EXTRA_TEXT, uri.toString())
|
||||
putExtra(Intent.EXTRA_TEXT, fullUri)
|
||||
type = "text/plain"
|
||||
startActivity(Intent.createChooser(this, null))
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue