From 03c48e6f3d00077ea2775934ae27882dc651d880 Mon Sep 17 00:00:00 2001 From: imndx Date: Sat, 31 Aug 2019 00:12:39 +0800 Subject: [PATCH] load url in WfcWebViewActivity --- chat/src/main/AndroidManifest.xml | 17 +++-- .../java/cn/wildfire/chat/kit/WfcIntent.java | 1 + .../TextMessageContentViewHolder.java | 10 +++ .../chat/kit/widget/LinkClickListener.java | 6 ++ .../widget/LinkTextViewMovementMethod.java | 68 +++++++++++++++++++ 5 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 chat/src/main/java/cn/wildfire/chat/kit/widget/LinkClickListener.java create mode 100644 chat/src/main/java/cn/wildfire/chat/kit/widget/LinkTextViewMovementMethod.java diff --git a/chat/src/main/AndroidManifest.xml b/chat/src/main/AndroidManifest.xml index 1a0f8c9f8..391f62224 100644 --- a/chat/src/main/AndroidManifest.xml +++ b/chat/src/main/AndroidManifest.xml @@ -189,14 +189,19 @@ + android:label="火信" + android:launchMode="singleTask"> - + + + + + + @@ -216,10 +221,10 @@ - + android:screenOrientation="portrait" /> ViewConfiguration.getLongPressTimeout()) { + return true; + } + String url = null; + if (link[0] instanceof URLSpan) + url = ((URLSpan) link[0]).getURL(); + if (mListener != null && mListener.onLinkClick(url)) + return true; + else + link[0].onClick(widget); + } else if (action == MotionEvent.ACTION_DOWN) { + mLastActionDownTime = System.currentTimeMillis(); + } + return true; + } else { + Touch.onTouchEvent(widget, buffer, event); + return false; + } + } + return Touch.onTouchEvent(widget, buffer, event); + } +} + +