Search in sources :

Example 6 with StatusComment

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);
            }
        });
    }
}
Also used : StatusContent(org.aisen.weibo.sina.sinasdk.bean.StatusContent) DialogInterface(android.content.DialogInterface) StatusComment(org.aisen.weibo.sina.sinasdk.bean.StatusComment) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

StatusComment (org.aisen.weibo.sina.sinasdk.bean.StatusComment)6 ArrayList (java.util.ArrayList)3 Extra (org.aisen.android.component.orm.extra.Extra)3 DialogInterface (android.content.DialogInterface)2 StatusComments (org.aisen.weibo.sina.sinasdk.bean.StatusComments)2 AlertDialogWrapper (com.afollestad.materialdialogs.AlertDialogWrapper)1 List (java.util.List)1 TaskException (org.aisen.android.network.task.TaskException)1 StatusContent (org.aisen.weibo.sina.sinasdk.bean.StatusContent)1 WeiBoUser (org.aisen.weibo.sina.sinasdk.bean.WeiBoUser)1