|
|
@@ -1,30 +1,25 @@
|
|
|
package com.tencent.qcloud.tuikit.tuichat.classicui.widget;
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
|
import android.app.Activity;
|
|
|
import android.content.ClipData;
|
|
|
import android.content.ClipboardManager;
|
|
|
import android.content.Context;
|
|
|
-import android.content.Intent;
|
|
|
import android.graphics.Color;
|
|
|
import android.graphics.drawable.AnimationDrawable;
|
|
|
-import android.net.Uri;
|
|
|
-import android.text.Spannable;
|
|
|
-import android.text.SpannableString;
|
|
|
-import android.text.TextPaint;
|
|
|
import android.text.TextUtils;
|
|
|
-import android.text.method.LinkMovementMethod;
|
|
|
-import android.text.style.ClickableSpan;
|
|
|
-import android.text.style.ForegroundColorSpan;
|
|
|
import android.util.AttributeSet;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
|
+
|
|
|
import androidx.annotation.NonNull;
|
|
|
import androidx.annotation.Nullable;
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
+
|
|
|
import com.google.gson.Gson;
|
|
|
import com.tencent.imsdk.v2.V2TIMGroupAtInfo;
|
|
|
import com.tencent.qcloud.tuicore.TUIConstants;
|
|
|
@@ -66,6 +61,7 @@ import com.tencent.qcloud.tuikit.tuichat.presenter.GroupChatPresenter;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.util.ChatMessageBuilder;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.util.TUIChatLog;
|
|
|
import com.tencent.qcloud.tuikit.tuichat.util.TUIChatUtils;
|
|
|
+
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
@@ -102,12 +98,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
getTitleBar().getMiddleTitle().setText(R.string.typing);
|
|
|
|
|
|
if (mTypingRunnable == null) {
|
|
|
- mTypingRunnable = new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- getTitleBar().getMiddleTitle().setText(oldTitle);
|
|
|
- }
|
|
|
- };
|
|
|
+ mTypingRunnable = () -> getTitleBar().getMiddleTitle().setText(oldTitle);
|
|
|
}
|
|
|
getTitleBar().getMiddleTitle().removeCallbacks(mTypingRunnable);
|
|
|
getTitleBar().getMiddleTitle().postDelayed(mTypingRunnable, TUIChatConstants.TYPING_PARSE_MESSAGE_INTERVAL * 1000);
|
|
|
@@ -179,12 +170,9 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
mJumpMessageLayout.setVisibility(VISIBLE);
|
|
|
mArrowImageView.setBackgroundResource(TUIThemeManager.getAttrResId(getContext(), R.attr.chat_jump_recent_down_icon));
|
|
|
mJumpMessageTextView.setText(getContext().getString(R.string.back_to_lastmessage));
|
|
|
- mJumpMessageLayout.setOnClickListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- locateOriginMessage(messageId);
|
|
|
- mClickLastMessageShow = true;
|
|
|
- }
|
|
|
+ mJumpMessageLayout.setOnClickListener(view -> {
|
|
|
+ locateOriginMessage(messageId);
|
|
|
+ mClickLastMessageShow = true;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -193,14 +181,11 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
mJumpMessageLayout.setVisibility(VISIBLE);
|
|
|
mArrowImageView.setBackgroundResource(TUIThemeManager.getAttrResId(getContext(), R.attr.chat_jump_recent_down_icon));
|
|
|
mJumpMessageTextView.setText(String.valueOf(count) + getContext().getString(R.string.back_to_newmessage));
|
|
|
- mJumpMessageLayout.setOnClickListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- locateOriginMessage(messageId);
|
|
|
- presenter.markMessageAsRead(mChatInfo);
|
|
|
- mJumpNewMessageShow = false;
|
|
|
- presenter.resetNewMessageCount();
|
|
|
- }
|
|
|
+ mJumpMessageLayout.setOnClickListener(view -> {
|
|
|
+ locateOriginMessage(messageId);
|
|
|
+ presenter.markMessageAsRead(mChatInfo);
|
|
|
+ mJumpNewMessageShow = false;
|
|
|
+ presenter.resetNewMessageCount();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -213,13 +198,10 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
} else {
|
|
|
mJumpMessageTextView.setText(getContext().getString(R.string.back_to_atmessage_me));
|
|
|
}
|
|
|
- mJumpMessageLayout.setOnClickListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- locateOriginMessageBySeq(groupAtInfo.getSeq());
|
|
|
- hideJumpMessageLayouts();
|
|
|
- mJumpGroupAtInfoShow = false;
|
|
|
- }
|
|
|
+ mJumpMessageLayout.setOnClickListener(view -> {
|
|
|
+ locateOriginMessageBySeq(groupAtInfo.getSeq());
|
|
|
+ hideJumpMessageLayouts();
|
|
|
+ mJumpGroupAtInfoShow = false;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -331,12 +313,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- mMessageRecyclerView.setMenuEmojiOnClickListener(new MessageRecyclerView.OnMenuEmojiClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(Emoji emoji, TUIMessageBean messageBean) {
|
|
|
- reactMessage(emoji, messageBean);
|
|
|
- }
|
|
|
- });
|
|
|
+ mMessageRecyclerView.setMenuEmojiOnClickListener(this::reactMessage);
|
|
|
|
|
|
loadMessages(
|
|
|
chatInfo.getLocateMessage(), chatInfo.getLocateMessage() == null ? TUIChatConstants.GET_MESSAGE_FORWARD : TUIChatConstants.GET_MESSAGE_TWO_WAY);
|
|
|
@@ -373,9 +350,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
|
|
|
@Override
|
|
|
public void onError(String module, int errCode, String errMsg) {
|
|
|
- if (errCode == TUIConstants.BuyingFeature.ERR_SDK_INTERFACE_NOT_SUPPORT) {
|
|
|
-// showNotSupportDialog();
|
|
|
- }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -385,7 +359,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
if (mAdapter == null || presenter == null) {
|
|
|
return;
|
|
|
}
|
|
|
- List<CallingMessageBean> tuiMessageBeans = new ArrayList<CallingMessageBean>();
|
|
|
+ List<CallingMessageBean> tuiMessageBeans = new ArrayList<>();
|
|
|
for (TUIMessageBean bean : mAdapter.getItemList(firstPosition, lastPosition)) {
|
|
|
if (bean instanceof CallingMessageBean) {
|
|
|
tuiMessageBeans.add((CallingMessageBean) bean);
|
|
|
@@ -424,12 +398,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
(long) TUICore.callService(TUIConstants.TUIConversation.SERVICE_NAME, TUIConstants.TUIConversation.METHOD_GET_TOTAL_UNREAD_COUNT, null);
|
|
|
}
|
|
|
updateUnreadCount(unreadCountTextView, unreadCount);
|
|
|
- unreadCountListener = new TotalUnreadCountListener() {
|
|
|
- @Override
|
|
|
- public void onTotalUnreadCountChanged(long totalUnreadCount) {
|
|
|
- updateUnreadCount(unreadCountTextView, totalUnreadCount);
|
|
|
- }
|
|
|
- };
|
|
|
+ unreadCountListener = totalUnreadCount -> updateUnreadCount(unreadCountTextView, totalUnreadCount);
|
|
|
TUIChatService.getInstance().addUnreadCountListener(unreadCountListener);
|
|
|
}
|
|
|
|
|
|
@@ -566,16 +535,8 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
.setTitle(getContext().getString(R.string.chat_delete_msg_tip))
|
|
|
.setDialogWidth(0.75f)
|
|
|
.setPositiveButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.sure),
|
|
|
- new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- deleteMessage(msg);
|
|
|
- }
|
|
|
- })
|
|
|
- .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {}
|
|
|
- });
|
|
|
+ v -> deleteMessage(msg))
|
|
|
+ .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), v -> {});
|
|
|
tipsDialog.show();
|
|
|
}
|
|
|
|
|
|
@@ -674,22 +635,14 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- getMessageLayout().setEmptySpaceClickListener(new MessageRecyclerView.OnEmptySpaceClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick() {
|
|
|
- getInputLayout().onEmptyClick();
|
|
|
- }
|
|
|
- });
|
|
|
+ getMessageLayout().setEmptySpaceClickListener(() -> getInputLayout().onEmptyClick());
|
|
|
|
|
|
getInputLayout().setChatInputHandler(new InputView.ChatInputHandler() {
|
|
|
@Override
|
|
|
public void onInputAreaClick() {
|
|
|
- post(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (presenter != null) {
|
|
|
- presenter.scrollToNewestMessage();
|
|
|
- }
|
|
|
+ post(() -> {
|
|
|
+ if (presenter != null) {
|
|
|
+ presenter.scrollToNewestMessage();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -746,61 +699,44 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
|
|
|
private void startRecording() {
|
|
|
- post(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- AudioPlayer.getInstance().stopPlay();
|
|
|
- mRecordingGroup.setVisibility(View.VISIBLE);
|
|
|
- mRecordingIcon.setImageResource(R.drawable.recording_volume);
|
|
|
- mVolumeAnim = (AnimationDrawable) mRecordingIcon.getDrawable();
|
|
|
- mVolumeAnim.start();
|
|
|
- mRecordingTips.setTextColor(Color.WHITE);
|
|
|
- mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.down_cancle_send));
|
|
|
- }
|
|
|
+ post(() -> {
|
|
|
+ AudioPlayer.getInstance().stopPlay();
|
|
|
+ mRecordingGroup.setVisibility(View.VISIBLE);
|
|
|
+ mRecordingIcon.setImageResource(R.drawable.recording_volume);
|
|
|
+ mVolumeAnim = (AnimationDrawable) mRecordingIcon.getDrawable();
|
|
|
+ mVolumeAnim.start();
|
|
|
+ mRecordingTips.setTextColor(Color.WHITE);
|
|
|
+ mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.down_cancle_send));
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void stopRecording() {
|
|
|
- post(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (mVolumeAnim != null) {
|
|
|
- mVolumeAnim.stop();
|
|
|
- }
|
|
|
- mRecordingGroup.setVisibility(View.GONE);
|
|
|
+ post(() -> {
|
|
|
+ if (mVolumeAnim != null) {
|
|
|
+ mVolumeAnim.stop();
|
|
|
}
|
|
|
+ mRecordingGroup.setVisibility(View.GONE);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void stopAbnormally(final int status) {
|
|
|
- post(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- mVolumeAnim.stop();
|
|
|
- mRecordingIcon.setImageResource(R.drawable.ic_volume_dialog_length_short);
|
|
|
- mRecordingTips.setTextColor(Color.WHITE);
|
|
|
- if (status == RECORD_TOO_SHORT) {
|
|
|
- mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.say_time_short));
|
|
|
- } else {
|
|
|
- mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.record_fail));
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- post(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- mRecordingGroup.setVisibility(View.GONE);
|
|
|
+ post(() -> {
|
|
|
+ mVolumeAnim.stop();
|
|
|
+ mRecordingIcon.setImageResource(R.drawable.ic_volume_dialog_length_short);
|
|
|
+ mRecordingTips.setTextColor(Color.WHITE);
|
|
|
+ if (status == RECORD_TOO_SHORT) {
|
|
|
+ mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.say_time_short));
|
|
|
+ } else {
|
|
|
+ mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.record_fail));
|
|
|
}
|
|
|
});
|
|
|
+ post(() -> mRecordingGroup.setVisibility(View.GONE));
|
|
|
}
|
|
|
|
|
|
private void cancelRecording() {
|
|
|
- post(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- mRecordingIcon.setImageResource(R.drawable.ic_volume_dialog_cancel);
|
|
|
- mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.up_cancle_send));
|
|
|
- }
|
|
|
+ post(() -> {
|
|
|
+ mRecordingIcon.setImageResource(R.drawable.ic_volume_dialog_cancel);
|
|
|
+ mRecordingTips.setText(TUIChatService.getAppContext().getString(R.string.up_cancle_send));
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -819,12 +755,9 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
@Override
|
|
|
public void initDefault(TUIBaseChatFragment fragment) {
|
|
|
getTitleBar().getLeftGroup().setVisibility(View.VISIBLE);
|
|
|
- getTitleBar().setOnLeftClickListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- if (getContext() instanceof Activity) {
|
|
|
- ((Activity) getContext()).finish();
|
|
|
- }
|
|
|
+ getTitleBar().setOnLeftClickListener(v -> {
|
|
|
+ if (getContext() instanceof Activity) {
|
|
|
+ ((Activity) getContext()).finish();
|
|
|
}
|
|
|
});
|
|
|
getInputLayout().setMessageHandler(new InputView.MessageHandler() {
|
|
|
@@ -870,14 +803,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
presenter.deleteMessage(msg);
|
|
|
}
|
|
|
|
|
|
- protected void deleteMessages(final List<Integer> positions) {
|
|
|
- presenter.deleteMessages(positions);
|
|
|
- }
|
|
|
-
|
|
|
- protected void deleteMessageInfos(final List<TUIMessageBean> msgIds) {
|
|
|
- presenter.deleteMessageInfos(msgIds);
|
|
|
- }
|
|
|
-
|
|
|
protected boolean checkFailedMessageInfos(final List<TUIMessageBean> msgIds) {
|
|
|
return presenter.checkFailedMessageInfos(msgIds);
|
|
|
}
|
|
|
@@ -933,17 +858,15 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
} else {
|
|
|
getTitleBar().setTitle("", TitleBarLayout.Position.LEFT);
|
|
|
}
|
|
|
- getTitleBar().setOnLeftClickListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- if (getContext() instanceof Activity) {
|
|
|
- ((Activity) getContext()).finish();
|
|
|
- }
|
|
|
+ getTitleBar().setOnLeftClickListener(v -> {
|
|
|
+ if (getContext() instanceof Activity) {
|
|
|
+ ((Activity) getContext()).finish();
|
|
|
}
|
|
|
});
|
|
|
getInputLayout().setVisibility(VISIBLE);
|
|
|
}
|
|
|
|
|
|
+ @SuppressLint("NotifyDataSetChanged")
|
|
|
private void resetForwardState(String leftTitle) {
|
|
|
if (mAdapter != null) {
|
|
|
mAdapter.setShowMultiSelectCheckBox(false);
|
|
|
@@ -960,12 +883,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
getTitleBar().getLeftIcon().setVisibility(GONE);
|
|
|
final CharSequence leftTitle = getTitleBar().getLeftTitle().getText();
|
|
|
getTitleBar().setTitle(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), TitleBarLayout.Position.LEFT);
|
|
|
- getTitleBar().setOnLeftClickListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- resetForwardState(leftTitle.toString());
|
|
|
- }
|
|
|
- });
|
|
|
+ getTitleBar().setOnLeftClickListener(v -> resetForwardState(leftTitle.toString()));
|
|
|
getInputLayout().setVisibility(GONE);
|
|
|
}
|
|
|
|
|
|
@@ -1018,17 +936,11 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
.setTitle(getContext().getString(R.string.forward_oneByOne_limit_number_tip))
|
|
|
.setDialogWidth(0.75f)
|
|
|
.setPositiveButton(getContext().getString(R.string.forward_mode_merge),
|
|
|
- new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
+ v -> {
|
|
|
startSelectForwardActivity(TUIChatConstants.FORWARD_MODE_MERGE, messageInfoList);
|
|
|
resetForwardState("返回");
|
|
|
- }
|
|
|
- })
|
|
|
- .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {}
|
|
|
- });
|
|
|
+ })
|
|
|
+ .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), v -> {});
|
|
|
tipsDialog.show();
|
|
|
}
|
|
|
|
|
|
@@ -1047,12 +959,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
@Override
|
|
|
public void onSuccess(TUIMessageBean data) {
|
|
|
TUIChatUtils.callbackOnSuccess(callback, data);
|
|
|
- ThreadUtils.runOnUiThread(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- scrollToEnd();
|
|
|
- }
|
|
|
- });
|
|
|
+ ThreadUtils.runOnUiThread(() -> scrollToEnd());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -1086,12 +993,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
presenter.sendMessage(msg, retry, new IUIKitCallback<TUIMessageBean>() {
|
|
|
@Override
|
|
|
public void onSuccess(TUIMessageBean data) {
|
|
|
- ThreadUtils.runOnUiThread(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- scrollToEnd();
|
|
|
- }
|
|
|
- });
|
|
|
+ ThreadUtils.runOnUiThread(() -> scrollToEnd());
|
|
|
presenter.modifyRootMessageToAddReplyInfo((ReplyMessageBean) data, new IUIKitCallback<Void>() {
|
|
|
@Override
|
|
|
public void onError(String module, int errCode, String errMsg) {
|
|
|
@@ -1155,7 +1057,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
|
|
|
public interface ForwardSelectActivityListener {
|
|
|
- public void onStartForwardSelectActivity(int mode, List<TUIMessageBean> msgIds);
|
|
|
+ void onStartForwardSelectActivity(int mode, List<TUIMessageBean> msgIds);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -1175,66 +1077,4 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
sendMsgReadReceipt(firstVisiblePosition, lastVisiblePosition);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- private void showNotSupportDialog() {
|
|
|
- String string = getResources().getString(R.string.chat_im_flagship_edition_update_tip, getResources().getString(R.string.chat_message_read_receipt));
|
|
|
- String buyingGuidelines = getResources().getString(R.string.chat_buying_guidelines);
|
|
|
- int buyingGuidelinesIndex = string.lastIndexOf(buyingGuidelines);
|
|
|
- final int foregroundColor = getResources().getColor(TUIThemeManager.getAttrResId(getContext(), com.tencent.qcloud.tuicore.R.attr.core_primary_color));
|
|
|
- SpannableString spannedString = new SpannableString(string);
|
|
|
- ForegroundColorSpan colorSpan2 = new ForegroundColorSpan(foregroundColor);
|
|
|
- spannedString.setSpan(colorSpan2, buyingGuidelinesIndex, buyingGuidelinesIndex + buyingGuidelines.length(), Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
|
|
-
|
|
|
- ClickableSpan clickableSpan2 = new ClickableSpan() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- if (TextUtils.equals(TUIThemeManager.getInstance().getCurrentLanguage(), "zh")) {
|
|
|
- openWebUrl(TUIConstants.BuyingFeature.BUYING_PRICE_DESC);
|
|
|
- } else {
|
|
|
- openWebUrl(TUIConstants.BuyingFeature.BUYING_PRICE_DESC_EN);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateDrawState(TextPaint ds) {
|
|
|
- ds.setUnderlineText(false);
|
|
|
- }
|
|
|
- };
|
|
|
- spannedString.setSpan(clickableSpan2, buyingGuidelinesIndex, buyingGuidelinesIndex + buyingGuidelines.length(), Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
|
|
- TUIKitDialog.TUIIMUpdateDialog.getInstance()
|
|
|
- .createDialog(getContext())
|
|
|
- .setShowOnlyDebug(true)
|
|
|
- .setMovementMethod(LinkMovementMethod.getInstance())
|
|
|
- .setHighlightColor(Color.TRANSPARENT)
|
|
|
- .setCancelable(true)
|
|
|
- .setCancelOutside(true)
|
|
|
- .setTitle(spannedString)
|
|
|
- .setDialogWidth(0.75f)
|
|
|
- .setDialogFeatureName(TUIConstants.BuyingFeature.BUYING_FEATURE_MESSAGE_RECEIPT)
|
|
|
- .setPositiveButton(getResources().getString(R.string.chat_no_more_reminders),
|
|
|
- new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- TUIKitDialog.TUIIMUpdateDialog.getInstance().dismiss();
|
|
|
- TUIKitDialog.TUIIMUpdateDialog.getInstance().setNeverShow(true);
|
|
|
- }
|
|
|
- })
|
|
|
- .setNegativeButton(getResources().getString(R.string.chat_i_know),
|
|
|
- new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- TUIKitDialog.TUIIMUpdateDialog.getInstance().dismiss();
|
|
|
- }
|
|
|
- })
|
|
|
- .show();
|
|
|
- }
|
|
|
-
|
|
|
- private void openWebUrl(String url) {
|
|
|
- Intent intent = new Intent();
|
|
|
- intent.setAction(Intent.ACTION_VIEW);
|
|
|
- Uri contentUrl = Uri.parse(url);
|
|
|
- intent.setData(contentUrl);
|
|
|
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
- getContext().startActivity(intent);
|
|
|
- }
|
|
|
}
|