예제 #1
0
  public static void updateShopShareReplyView(
      final ShareEntity share, final Activity activity, final View shareView) {
    updateShareDetailView(share, activity, shareView);

    // 设置反馈状态
    TextView replyStatus = (TextView) shareView.findViewById(R.id.reply_status);
    replyStatus.setVisibility(View.VISIBLE);
    ShopReplyEntity reply = share.getShopReply();
    if (reply == null) {
      replyStatus.setText(R.string.label_share_reply_no);
    } else {
      String status = reply.getStatus();
      if (DataConst.STATUS_AUDITED.equals(status)) {
        replyStatus.setText(R.string.label_share_reply_status_valid);
      } else {
        replyStatus.setText(R.string.label_share_reply_status_draft);
      }
    }
    updateShopReplyView(activity, share, shareView);

    // 设置评论信息
    ListView commentView = (ListView) shareView.findViewById(R.id.comment_list);
    List<CommentEntity> comments = share.getComments();
    final CommentListAdapter commentAdapter = new CommentListAdapter(activity, comments, true);
    commentView.setAdapter(commentAdapter);

    ImageView commentButton = (ImageView) shareView.findViewById(R.id.share_comment_action);
    if (reply == null) {
      commentButton.setImageResource(R.drawable.reply);
      commentButton.setOnClickListener(
          new View.OnClickListener() {

            @Override
            public void onClick(View v) {
              ViewUtils.popupInputMethodWindow(activity); // 打开输入键盘

              ShareReplyPopWindow popupWindow = new ShareReplyPopWindow();
              popupWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
              popupWindow.setWidth(WindowManager.LayoutParams.FILL_PARENT);
              popupWindow.init(activity, share);
              popupWindow.setBackgroundDrawable(new BitmapDrawable());
              popupWindow.setOutsideTouchable(true);
              popupWindow.setFocusable(true);
              popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

              popupWindow.showAtLocation(shareView, Gravity.BOTTOM, 0, 0);
            }
          });
    } else {
      commentButton.setVisibility(View.GONE);
    }
  }
예제 #2
0
  public static void updateUserShareDetailView(
      ShareEntity share, Activity activity, View shareView) {
    updateFriendShareItemView(share, activity, shareView);

    // 设置反馈状态
    TextView replyStatus = (TextView) shareView.findViewById(R.id.reply_status);
    replyStatus.setVisibility(View.VISIBLE);
    ShopReplyEntity reply = share.getShopReply();
    if (reply == null) {
      replyStatus.setText("商户尚未反馈");
    } else {
      // replyStatus.setVisibility(View.GONE);
      String status = reply.getStatus();
      if (DataConst.STATUS_AUDITED.equals(status)) {
        replyStatus.setText(R.string.label_share_reply_status_valid);
      } else {
        replyStatus.setText(R.string.label_share_reply_status_draft);
      }
    }
    updateShopReplyView(activity, share, shareView);
  }