|
@@ -101,6 +101,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
private int mTipColor;
|
|
|
|
|
|
private static final int TIP_COLOR = 0xFFFFFFFF;//默认颜色
|
|
|
+ private AlertDialog alertDialog;
|
|
|
|
|
|
public ExpandTextView(Context context) {
|
|
|
this(context, null);
|
|
@@ -125,6 +126,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
* 使用前必须调用该方法
|
|
|
*/
|
|
|
public void init(BaseFragment baseFragment, boolean toExpand, String text, @Nullable CreateAppenderListener createAppenderListener) {
|
|
|
+ alertDialog = new AlertDialog(baseFragment.getParentActivity(), 3);
|
|
|
this.baseFragment = baseFragment;
|
|
|
mMaxLines = getMaxLines();
|
|
|
originText = ToDBC ? ToDBC(text) : toDBC(text);
|
|
@@ -290,6 +292,9 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
ClickableSpan clickableSpan = new ClickableSpan() {
|
|
|
@Override
|
|
|
public void onClick(View widget) {
|
|
|
+ if (alertDialog != null) {
|
|
|
+ alertDialog.show();
|
|
|
+ }
|
|
|
if (finalWorkingText.contains("https://t.me/")) {
|
|
|
int index = finalWorkingText.indexOf("https://t.me/");
|
|
|
int end = finalWorkingText.indexOf(" ", index);
|
|
@@ -323,6 +328,9 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
}
|
|
|
// TODO: 2022/11/16 群组跳转带+号的现在仍然跳转失败
|
|
|
requestId[0] = ConnectionsManager.getInstance(intentAccount[0]).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
|
|
+ if (alertDialog != null) {
|
|
|
+ alertDialog.dismiss();
|
|
|
+ }
|
|
|
TLRPC.TL_contacts_resolvedPeer res = (TLRPC.TL_contacts_resolvedPeer) response;
|
|
|
if (error == null && res != null && res.users != null) {
|
|
|
MessagesController.getInstance(intentAccount[0]).putUsers(res.users, false);
|
|
@@ -341,7 +349,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
ChatActivity fragment = new ChatActivity(args);
|
|
|
baseFragment.presentFragment(fragment);
|
|
|
} else {
|
|
|
- ToastUtil.show(baseFragment.getParentActivity(), "Username not found");
|
|
|
+ ToastUtil.show(baseFragment.getParentActivity(), LocaleController.getString("ExpiredLink", R.string.ExpiredLink));
|
|
|
// if (res != null && res.chats != null) {
|
|
|
// if (res.chats.isEmpty()) {
|
|
|
// ToastUtil.show(baseFragment.getParentActivity(), "Username not found");
|
|
@@ -354,6 +362,9 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
final TLRPC.TL_messages_checkChatInvite req = new TLRPC.TL_messages_checkChatInvite();
|
|
|
req.hash = group;
|
|
|
requestId[0] = ConnectionsManager.getInstance(intentAccount[0]).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
|
|
+ if (alertDialog != null) {
|
|
|
+ alertDialog.dismiss();
|
|
|
+ }
|
|
|
if (error == null) {
|
|
|
TLRPC.ChatInvite invite = (TLRPC.ChatInvite) response;
|
|
|
if (invite.chat != null && (!ChatObject.isLeftFromChat(invite.chat) || !invite.chat.kicked && (!TextUtils.isEmpty(invite.chat.username) || invite instanceof TLRPC.TL_chatInvitePeek || invite.chat.has_geo))) {
|
|
@@ -367,6 +378,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
baseFragment.presentFragment(fragment);
|
|
|
}
|
|
|
} else {
|
|
|
+ ToastUtil.show(baseFragment.getParentActivity(), LocaleController.getString("ExpiredLink", R.string.ExpiredLink));
|
|
|
// AlertDialog.Builder builder = new AlertDialog.Builder(baseFragment.getParentActivity());
|
|
|
// builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
|
|
// if (error.text.startsWith("FLOOD_WAIT")) {
|