Ejemplo n.º 1
0
  private static void updateShopReplyView(
      final Context context, final ShareEntity share, View shareView) {
    ShopReplyEntity reply = share.getShopReply();
    View replyView = shareView.findViewById(R.id.shop_reply_main);
    if (reply == null) {
      replyView.setVisibility(View.GONE);
    } else {
      replyView.setVisibility(View.VISIBLE);

      TextView shopNameView = (TextView) shareView.findViewById(R.id.shop_name);
      shopNameView.getPaint().setFakeBoldText(true);
      shopNameView.setText(share.getShop().getName());
      shopNameView.setOnClickListener(
          new View.OnClickListener() {

            @Override
            public void onClick(View v) {
              Intent intent = new Intent(context, ShopBaseInfoActivity.class);
              intent.putExtra(ShopConst.COL_NAME_UUID, share.getShopId());
              context.startActivity(intent);
            }
          });

      TextView gradeView = (TextView) shareView.findViewById(R.id.reply_grade);
      gradeView.getPaint().setFakeBoldText(true);
      gradeView.setText(String.valueOf(reply.getGrade()));

      TextView contentView = (TextView) shareView.findViewById(R.id.reply_content);
      contentView.setText(reply.getContent());
    }
  }
Ejemplo n.º 2
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);
    }
  }
Ejemplo n.º 3
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);
  }