From 54644db587ca0e923db69ebf589274b73dada323 Mon Sep 17 00:00:00 2001 From: onurays Date: Thu, 23 Apr 2020 17:37:30 +0300 Subject: [PATCH] Dialog design fixes. --- .../home/room/detail/RoomDetailFragment.kt | 1 + .../timeline/tools/EventRenderingTools.kt | 23 ++++++++++--------- vector/src/main/res/values/strings_riotX.xml | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index 6a3a97037f..99db586d1f 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -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) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/tools/EventRenderingTools.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/tools/EventRenderingTools.kt index 46d27bb4de..f633788199 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/tools/EventRenderingTools.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/tools/EventRenderingTools.kt @@ -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 + } + } } - } - } } diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index de1d53d8a1..edeb82ccd0 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -22,7 +22,7 @@ Double-check this link - The link %1$s is taking you to another site:\n%2$s. Are you sure you want to continue? + The link %1$s is taking you to another site: %2$s.\n\nAre you sure you want to continue? Continue Cancel