Dialog design fixes.

This commit is contained in:
onurays 2020-04-23 17:37:30 +03:00
parent ec2ba7c0b2
commit 54644db587
3 changed files with 14 additions and 12 deletions

View File

@ -965,6 +965,7 @@ class RoomDetailFragment @Inject constructor(
}
.setNegativeButton(R.string.external_link_confirmation_positive_button, null)
.show()
.withColoredButton(DialogInterface.BUTTON_NEGATIVE)
} else {
// Open in external browser, in a new Tab
openUrlInExternalBrowser(requireContext(), url)

View File

@ -62,16 +62,17 @@ fun createLinkMovementMethod(urlClickCallback: TimelineEventController.UrlClickC
override fun onLinkClicked(textView: TextView, span: ClickableSpan, url: String, actualText: String): Boolean {
return url.isValidUrl() && urlClickCallback?.onUrlClicked(url, actualText) == true
}
}).apply {
// We need also to fix the case when long click on link will trigger long click on cell
setOnLinkLongClickListener { tv, url ->
// Long clicks are handled by parent, return true to block android to do something with url
if (url.isValidUrl() && urlClickCallback?.onUrlLongClicked(url) == true) {
tv.dispatchTouchEvent(MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0f, 0f, 0))
true
} else {
false
})
.apply {
// We need also to fix the case when long click on link will trigger long click on cell
setOnLinkLongClickListener { tv, url ->
// Long clicks are handled by parent, return true to block android to do something with url
if (url.isValidUrl() && urlClickCallback?.onUrlLongClicked(url) == true) {
tv.dispatchTouchEvent(MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0f, 0f, 0))
true
} else {
false
}
}
}
}
}
}

View File

@ -22,7 +22,7 @@
<!-- BEGIN Strings added by Onuray -->
<string name="external_link_confirmation_title">Double-check this link</string>
<string name="external_link_confirmation_message">The link %1$s is taking you to another site:\n%2$s. Are you sure you want to continue?</string>
<string name="external_link_confirmation_message">The link %1$s is taking you to another site: %2$s.\n\nAre you sure you want to continue?</string>
<string name="external_link_confirmation_negative_button">Continue</string>
<string name="external_link_confirmation_positive_button">Cancel</string>
<!-- END Strings added by Onuray -->