Ejemplo n.º 1
0
 public void onClick(View v) {
   if (commentController.isNetworkAvailable(context)) {
     int i = (Integer) v.getTag();
     String userid = commentList.get(i).getCommenter().getUniqueID();
     Intent intent = new Intent(context, ProfileViewActivity.class);
     intent.putExtra(EXTRA_USERID, userid);
     context.startActivity(intent);
   }
 }
Ejemplo n.º 2
0
        public void onClick(View v) {
          if (commentController.isNetworkAvailable(context)) {
            final int i = (Integer) v.getTag();
            setupDialogs();
            AlertDialog dialog =
                new AlertDialog.Builder(context)
                    .setTitle("Create Comment")
                    .setView(createView)
                    .setPositiveButton(
                        "OK",
                        new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int whichButton) {
                            String title = inputTitle.getText().toString();
                            String text = inputComment.getText().toString();

                            Comment currentComment = commentList.get(i);
                            commentController = new CommentController(currentComment);
                            // create comment with image else one with no image
                            if (inputImage.getVisibility() == View.VISIBLE) {
                              inputImage.buildDrawingCache(true);
                              Bitmap bitmap =
                                  inputImage.getDrawingCache(true).copy(Config.RGB_565, false);
                              inputImage.destroyDrawingCache();
                              commentController.addReplyImg(
                                  currentComment.getElasticID(),
                                  (Activity) context,
                                  title,
                                  text,
                                  bitmap);
                            } else {
                              commentController.addReply(
                                  currentComment.getElasticID(), (Activity) context, title, text);
                            }
                            notifyDataSetChanged();
                          }
                        })
                    .setNegativeButton("Cancel", null)
                    .create();
            dialog.show();
          }
        }