资讯文章超链接支持跳转到社区文章

This commit is contained in:
kehaoyuan
2019-04-04 16:21:50 +08:00
parent f5a9e7b487
commit 2b2b71fe01
2 changed files with 28 additions and 1 deletions

View File

@ -261,7 +261,7 @@ public class MainActivity extends BaseActivity {
if (isNewFirstLaunch) {
// 延时两秒提交 APP 启动日志的,避免提交时还没获取到 GID
AppExecutor.getUiExecutor().executeWithDelay(() -> {
if(!this.isFinishing()) {
if (!this.isFinishing()) {
LogUtils.uploadDevice(DeviceTokenUtils.getLaunchType());
}
}, 2000L);

View File

@ -310,6 +310,33 @@ public class NewsDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
DirectUtils.directToAnswerDetail(mContext, id,
StringUtils.buildString(mEntrance, "+(新闻详情[", mNewsDetailEntity.getTitle(), "])"), "文章链接");
break;
case "communities": // community_article
// ghzhushou://communities/5a32405b2397ab000f688de3/articles/5c99d262c140b321564f04e3
String communityId = "";
String type = "";
String typeId = "";
String[] split = id.split("/");
for (String text : split) {
if (TextUtils.isEmpty(communityId)) {
communityId = text;
continue;
}
if (TextUtils.isEmpty(type)) {
type = text;
continue;
}
if (TextUtils.isEmpty(typeId)) {
typeId = text;
}
}
if ("articles".equals(type)) {
CommunityEntity communityEntity = new CommunityEntity();
communityEntity.setId(communityId);
DirectUtils.directToCommunityArticle(
mContext, typeId, communityId,
StringUtils.buildString(mEntrance, "+(新闻详情[", mNewsDetailEntity.getTitle(), "])"));
break;
}
default:
DialogUtils.showLowVersionDialog(mContext);
break;