mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-21 19:41:38 -04:00
Implemented LongClick Functionality
This commit is contained in:
parent
fe459e6902
commit
fac6c13098
@ -70,17 +70,17 @@ class AlertDialogShower @Inject constructor(private val activity: Activity) :
|
|||||||
textView.setPadding(5, 5, 5, 5)
|
textView.setPadding(5, 5, 5, 5)
|
||||||
textView.gravity = Gravity.CENTER
|
textView.gravity = Gravity.CENTER
|
||||||
textView.setLinkTextColor(Color.BLUE)
|
textView.setLinkTextColor(Color.BLUE)
|
||||||
textView.setOnClickListener {
|
textView.setOnLongClickListener {
|
||||||
val clipboard =
|
val clipboard =
|
||||||
ContextCompat.getSystemService(activity.baseContext, ClipboardManager::class.java)
|
ContextCompat.getSystemService(activity.baseContext, ClipboardManager::class.java)
|
||||||
val clip = ClipData.newPlainText("External Url", "$url")
|
val clip = ClipData.newPlainText("External Url", "$url")
|
||||||
clipboard?.setPrimaryClip(clip)
|
clipboard?.setPrimaryClip(clip)
|
||||||
|
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
activity.baseContext,
|
activity.baseContext,
|
||||||
"External Link Copied to Clipboard",
|
"External Link Copied to Clipboard",
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
|
true
|
||||||
}
|
}
|
||||||
textView.text = Html.fromHtml("</br><a href=$url> <b>$url</b>")
|
textView.text = Html.fromHtml("</br><a href=$url> <b>$url</b>")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user