89 lines
3.8 KiB
Java
89 lines
3.8 KiB
Java
package com.gh.gamecenter;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
|
|
import com.gh.common.util.DisplayUtils;
|
|
import com.gh.common.util.EntranceUtils;
|
|
import com.gh.gamecenter.entity.LinkEntity;
|
|
import com.gh.gamecenter.entity.MessageEntity;
|
|
import com.gh.gamecenter.qa.comment.CommentActivity;
|
|
import com.gh.gamecenter.qa.comment.NewCommentConversationFragment;
|
|
import com.halo.assistant.fragment.comment.CommentDetailFragment;
|
|
|
|
import butterknife.BindView;
|
|
|
|
/**
|
|
* Created by khy on 2017/3/22.
|
|
*/
|
|
public class CommentDetailActivity extends NormalActivity {
|
|
|
|
@BindView(R.id.shadowView)
|
|
public View shadowView;
|
|
|
|
@Override
|
|
protected int getLayoutId() {
|
|
return R.layout.toolbar_shadow;
|
|
}
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
ViewGroup.LayoutParams layoutParams = shadowView.getLayoutParams();
|
|
layoutParams.height = DisplayUtils.dip2px(50f) + DisplayUtils.getStatusBarHeight(getResources());
|
|
shadowView.setLayoutParams(layoutParams);
|
|
DisplayUtils.setStatusBarColor(this, R.color.transparent, true);
|
|
}
|
|
|
|
// article 不为空则显示跳转原文按钮
|
|
public static Intent getIntent(Context context, String commentId, MessageEntity.Article article) {
|
|
Bundle args = new Bundle();
|
|
args.putString(EntranceUtils.KEY_COMMENTID, commentId);
|
|
args.putParcelable(MessageEntity.Article.TAG, article);
|
|
return getTargetIntent(context, CommentDetailActivity.class, CommentDetailFragment.class, args);
|
|
}
|
|
|
|
public static Intent getAnswerCommentIntent(Context context,
|
|
String commentId,
|
|
String answerId,
|
|
LinkEntity linkEntity) {
|
|
Bundle args = new Bundle();
|
|
args.putString(EntranceUtils.KEY_COMMENTID, commentId);
|
|
args.putString(EntranceUtils.KEY_ANSWER_ID, answerId);
|
|
args.putParcelable(EntranceUtils.KEY_LINK, linkEntity);
|
|
return getTargetIntent(context, CommentDetailActivity.class, NewCommentConversationFragment.class, args);
|
|
}
|
|
|
|
|
|
public static Intent getCommunityArticleCommentIntent(Context context,
|
|
String articleId,
|
|
String articleCommentId,
|
|
String communityId,
|
|
LinkEntity linkEntity) {
|
|
Bundle args = new Bundle();
|
|
args.putString(CommentActivity.ARTICLE_ID, articleId);
|
|
args.putString(EntranceUtils.KEY_COMMENTID, articleCommentId);
|
|
args.putString(CommentActivity.COMMUNITY_ID, communityId);
|
|
args.putParcelable(EntranceUtils.KEY_LINK, linkEntity);
|
|
return getTargetIntent(context, CommentDetailActivity.class, NewCommentConversationFragment.class, args);
|
|
}
|
|
|
|
public static Intent getVideoCommentIntent(Context context,
|
|
String commentId,
|
|
String videoId,
|
|
boolean isVideoAuthor,
|
|
LinkEntity linkEntity) {
|
|
Bundle args = new Bundle();
|
|
args.putString(EntranceUtils.KEY_COMMENTID, commentId);
|
|
args.putString(CommentActivity.VIDEO_ID, videoId);
|
|
args.putBoolean(CommentActivity.IS_VIDEO_AUTHOR, isVideoAuthor);
|
|
args.putParcelable(EntranceUtils.KEY_LINK, linkEntity);
|
|
return getTargetIntent(context, CommentDetailActivity.class, NewCommentConversationFragment.class, args);
|
|
}
|
|
|
|
|
|
}
|