use of org.aisen.weibo.sina.sinasdk.bean.StatusComment in project AisenWeiBo by wangdan.
the class MentionCmtItemView method onClick.
@Override
public void onClick(View v) {
if (v.getId() == R.id.layStatus) {
final StatusContent status = (StatusContent) v.getTag();
TimelineDetailPagerFragment.launch(fragment.getActivity(), status);
} else if (v.getId() == R.id.btnMenus) {
final String[] commentMenuArr = GlobalContext.getInstance().getResources().getStringArray(R.array.cmt_menus);
final StatusComment comment = (StatusComment) v.getTag();
List<String> menuList = new ArrayList<String>();
// 转发
if (comment.getStatus() != null && (comment.getUser() != null && !comment.getUser().getIdstr().equals(AppContext.getAccount().getUser().getIdstr())))
menuList.add(commentMenuArr[1]);
// 复制
menuList.add(commentMenuArr[0]);
// 删除
if (comment.getUser() != null && AppContext.getAccount().getUser().getIdstr().equals(comment.getUser().getIdstr()))
menuList.add(commentMenuArr[2]);
final String[] menus = new String[menuList.size()];
for (int i = 0; i < menuList.size(); i++) menus[i] = menuList.get(i);
AisenUtils.showMenuDialog(fragment, v, menus, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
AisenUtils.commentMenuSelected(fragment, menus[which], comment);
}
});
}
}
Aggregations