Code review fixes.
This commit is contained in:
parent
c3299845c1
commit
72de5d6adc
@ -10,7 +10,7 @@ Features ✨:
|
|||||||
|
|
||||||
Improvements 🙌:
|
Improvements 🙌:
|
||||||
- Verification DM / Handle concurrent .start after .ready (#794)
|
- Verification DM / Handle concurrent .start after .ready (#794)
|
||||||
- Reimplementation of multiple attachment picker@
|
- Reimplementation of multiple attachment picker
|
||||||
- Cross-Signing | Update Shield Logic for DM (#963)
|
- Cross-Signing | Update Shield Logic for DM (#963)
|
||||||
- Cross-Signing | Complete security new session design update (#1135)
|
- Cross-Signing | Complete security new session design update (#1135)
|
||||||
- Cross-Signing | Setup key backup as part of SSSS bootstrapping (#1201)
|
- Cross-Signing | Setup key backup as part of SSSS bootstrapping (#1201)
|
||||||
|
@ -951,7 +951,7 @@ class RoomDetailFragment @Inject constructor(
|
|||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe { managed ->
|
.subscribe { managed ->
|
||||||
if (!managed) {
|
if (!managed) {
|
||||||
if (title.isValidUrl() && URL(title).host != URL(url).host) {
|
if (title.isValidUrl() && url.isValidUrl() && URL(title).host != URL(url).host) {
|
||||||
AlertDialog.Builder(requireActivity())
|
AlertDialog.Builder(requireActivity())
|
||||||
.setTitle(R.string.external_link_confirmation_title)
|
.setTitle(R.string.external_link_confirmation_title)
|
||||||
.setMessage(
|
.setMessage(
|
||||||
@ -978,7 +978,7 @@ class RoomDetailFragment @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onUrlLongClicked(url: String): Boolean {
|
override fun onUrlLongClicked(url: String): Boolean {
|
||||||
if (url != getString(R.string.edited_suffix)) {
|
if (url != getString(R.string.edited_suffix) && url.isValidUrl()) {
|
||||||
// Copy the url to the clipboard
|
// Copy the url to the clipboard
|
||||||
copyToClipboard(requireContext(), url, true, R.string.link_copied_to_clipboard)
|
copyToClipboard(requireContext(), url, true, R.string.link_copied_to_clipboard)
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ import im.vector.matrix.android.api.permalinks.MatrixLinkify
|
|||||||
import im.vector.matrix.android.api.permalinks.MatrixPermalinkSpan
|
import im.vector.matrix.android.api.permalinks.MatrixPermalinkSpan
|
||||||
import im.vector.riotx.core.linkify.VectorLinkify
|
import im.vector.riotx.core.linkify.VectorLinkify
|
||||||
import im.vector.riotx.core.utils.EvenBetterLinkMovementMethod
|
import im.vector.riotx.core.utils.EvenBetterLinkMovementMethod
|
||||||
import im.vector.riotx.core.utils.isValidUrl
|
|
||||||
import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController
|
import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController
|
||||||
import im.vector.riotx.features.html.PillImageSpan
|
import im.vector.riotx.features.html.PillImageSpan
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
@ -60,14 +59,14 @@ fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): C
|
|||||||
fun createLinkMovementMethod(urlClickCallback: TimelineEventController.UrlClickCallback?): EvenBetterLinkMovementMethod {
|
fun createLinkMovementMethod(urlClickCallback: TimelineEventController.UrlClickCallback?): EvenBetterLinkMovementMethod {
|
||||||
return EvenBetterLinkMovementMethod(object : EvenBetterLinkMovementMethod.OnLinkClickListener {
|
return EvenBetterLinkMovementMethod(object : EvenBetterLinkMovementMethod.OnLinkClickListener {
|
||||||
override fun onLinkClicked(textView: TextView, span: ClickableSpan, url: String, actualText: String): Boolean {
|
override fun onLinkClicked(textView: TextView, span: ClickableSpan, url: String, actualText: String): Boolean {
|
||||||
return url.isValidUrl() && urlClickCallback?.onUrlClicked(url, actualText) == true
|
return urlClickCallback?.onUrlClicked(url, actualText) == true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.apply {
|
.apply {
|
||||||
// We need also to fix the case when long click on link will trigger long click on cell
|
// We need also to fix the case when long click on link will trigger long click on cell
|
||||||
setOnLinkLongClickListener { tv, url ->
|
setOnLinkLongClickListener { tv, url ->
|
||||||
// Long clicks are handled by parent, return true to block android to do something with url
|
// Long clicks are handled by parent, return true to block android to do something with url
|
||||||
if (url.isValidUrl() && urlClickCallback?.onUrlLongClicked(url) == true) {
|
if (urlClickCallback?.onUrlLongClicked(url) == true) {
|
||||||
tv.dispatchTouchEvent(MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0f, 0f, 0))
|
tv.dispatchTouchEvent(MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0f, 0f, 0))
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user