|
@@ -5,6 +5,7 @@ import android.content.res.TypedArray;
|
|
|
import android.graphics.Color;
|
|
|
import android.graphics.Paint;
|
|
|
import android.os.Build;
|
|
|
+import android.os.Bundle;
|
|
|
import android.text.Layout;
|
|
|
import android.text.Spannable;
|
|
|
import android.text.SpannableString;
|
|
@@ -19,12 +20,16 @@ import android.view.View;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
|
+import org.telegram.cricdit.bean.GroupInfoBean;
|
|
|
import org.telegram.cricdit.config.Constants;
|
|
|
+import org.telegram.cricdit.mvp.CommentPresenter;
|
|
|
import org.telegram.messenger.R;
|
|
|
|
|
|
//import com.alibaba.android.arouter.launcher.ARouter;
|
|
|
//import com.cricdit.libbase.arouter.ARouterPath;
|
|
|
import org.telegram.cricdit.base.BaseObserver;
|
|
|
+import org.telegram.ui.ActionBar.BaseFragment;
|
|
|
+import org.telegram.ui.ProfileActivity;
|
|
|
//import com.cricdit.libbase.constants.Constants;
|
|
|
//import com.cricdit.module.main.R;
|
|
|
//import com.cricdit.module.main.bean.GroupInfoBean;
|
|
@@ -72,6 +77,8 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
private int mToExpandImageWidth = 0;
|
|
|
private int mToCloseImageWidth = 0;
|
|
|
|
|
|
+ BaseFragment baseFragment;
|
|
|
+
|
|
|
/**
|
|
|
* 提示文字的颜色
|
|
|
*/
|
|
@@ -101,7 +108,8 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
/**
|
|
|
* 使用前必须调用该方法
|
|
|
*/
|
|
|
- public void init(boolean toExpand, String text, @Nullable CreateAppenderListener createAppenderListener) {
|
|
|
+ public void init(BaseFragment baseFragment, boolean toExpand, String text, @Nullable CreateAppenderListener createAppenderListener) {
|
|
|
+ this.baseFragment = baseFragment;
|
|
|
mMaxLines = getMaxLines();
|
|
|
originText = ToDBC ? ToDBC(text) : toDBC(text);
|
|
|
if (createAppenderListener != null) {
|
|
@@ -275,20 +283,21 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
} else {
|
|
|
gName = finalWorkingText.substring(index + "https://g.cricdit.com/".length());
|
|
|
}
|
|
|
-// new CommentPresenter().groupLinkInfo(gName, new BaseObserver<GroupInfoBean>() {
|
|
|
-// @Override
|
|
|
-// protected void onSuccess(GroupInfoBean data) {
|
|
|
+ new CommentPresenter().groupLinkInfo(gName, new BaseObserver<GroupInfoBean>() {
|
|
|
+ @Override
|
|
|
+ protected void onSuccess(GroupInfoBean data) {
|
|
|
// ARouter.getInstance().build(ARouterPath.PATH_CHAT_CHAT_ACTIVITY).withString(Constant.K_GROUP_ID, data.getGroup_id()).withString(Constant.K_GROUP_NAME, data.getGroup_name())
|
|
|
// .withString(Constant.K_GROUP_AVATAR, data.getGroup_image())
|
|
|
// .navigation();
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public void onError(Throwable e) {
|
|
|
-// super.onError(e);
|
|
|
-// }
|
|
|
-// });
|
|
|
+ //跳转到群组聊天界面
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(Throwable e) {
|
|
|
+ super.onError(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
} else if (finalWorkingText.contains("https://u.cricdit.com/")) {
|
|
|
int index = finalWorkingText.indexOf("https://u.cricdit.com/");
|
|
|
int end = finalWorkingText.indexOf(" ", index);
|
|
@@ -300,10 +309,10 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
|
}
|
|
|
// ARouter.getInstance().build(ARouterPath.PATH_CHAT_CHAT_ACTIVITY).withString(Constant.K_ID, userId)
|
|
|
// .navigation();
|
|
|
-// ARouter.getInstance()
|
|
|
-// .build(ARouterPath.PATH_MAIN_PERSON_DETAIL_ACTIVITY)
|
|
|
-// .withString(Constants.USER_ID, userId)
|
|
|
-// .navigation();
|
|
|
+ //跳转到个人聊天界面
|
|
|
+// Bundle args = new Bundle();
|
|
|
+// args.putLong("user_id", Long.parseLong(userId));
|
|
|
+// baseFragment.presentFragment(new ProfileActivity(args));
|
|
|
}
|
|
|
}
|
|
|
};
|