mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 15:05:44 +03:00
share conversation link
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
76451c1649
commit
bec19428e0
1 changed files with 32 additions and 1 deletions
|
@ -33,6 +33,13 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM
|
|||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
||||
import org.parceler.Parcels
|
||||
import javax.inject.Inject
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.nextcloud.talk.utils.ShareUtils
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils
|
||||
import kotlinx.android.synthetic.main.activity_take_picture.*
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
class ConversationOperationDialog(
|
||||
|
@ -50,6 +57,10 @@ class ConversationOperationDialog(
|
|||
@JvmField
|
||||
var ncApi: NcApi? = null
|
||||
|
||||
@Inject
|
||||
@JvmField
|
||||
var userUtils: UserUtils? = null
|
||||
|
||||
init {
|
||||
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
|
||||
}
|
||||
|
@ -198,7 +209,27 @@ class ConversationOperationDialog(
|
|||
}
|
||||
|
||||
binding.conversationOperationShareLink.setOnClickListener {
|
||||
// TODO share by intent
|
||||
val sendIntent: Intent = Intent().apply {
|
||||
action = Intent.ACTION_SEND
|
||||
type = "text/plain"
|
||||
putExtra(
|
||||
Intent.EXTRA_SUBJECT,
|
||||
String.format(
|
||||
activity.resources.getString(R.string.nc_share_subject),
|
||||
activity.resources.getString(R.string.nc_app_product_name)
|
||||
)
|
||||
)
|
||||
// password should not be shared!!
|
||||
putExtra(
|
||||
Intent.EXTRA_TEXT,
|
||||
ShareUtils.getStringForIntent(activity, null, userUtils, conversation)
|
||||
)
|
||||
}
|
||||
|
||||
val shareIntent = Intent.createChooser(sendIntent, null)
|
||||
activity.startActivity(shareIntent)
|
||||
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue