mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
SS-75 Added 'Copied' toast when the user copies a URL in the Open URL dialog
This commit is contained in:
parent
59b4805b8b
commit
9766c3fd0b
@ -22,6 +22,7 @@ import android.widget.RelativeLayout
|
||||
import android.widget.ScrollView
|
||||
import android.widget.Space
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.annotation.StringRes
|
||||
@ -202,8 +203,6 @@ public fun Context.copyURLToClipboard(url: String) {
|
||||
fun Context.showOpenUrlDialog(url: String, showCloseButton: Boolean = true): AlertDialog {
|
||||
|
||||
return SessionDialogBuilder(this).apply {
|
||||
|
||||
|
||||
// If we're not showing a close button we can just use a simple title..
|
||||
if (!showCloseButton) {
|
||||
title(R.string.urlOpen)
|
||||
@ -311,7 +310,10 @@ fun Context.showOpenUrlDialog(url: String, showCloseButton: Boolean = true): Ale
|
||||
// Note: The text and contentDescription are set on the `copyUrlButton` by the function.
|
||||
contentView.addView(scrollView)
|
||||
dangerButton(R.string.open, R.string.AccessibilityId_urlOpenBrowser) { openUrl(url) }
|
||||
copyUrlButton { context.copyURLToClipboard(url) }
|
||||
copyUrlButton {
|
||||
context.copyURLToClipboard(url)
|
||||
Toast.makeText(context, R.string.copied, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user