Show picture popups in task activity feed

pull/14/head
Sam Bosley 14 years ago
parent 6714d4986b
commit b395725fcc

@ -368,12 +368,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
// picture
final AsyncImageView commentPictureView = (AsyncImageView)view.findViewById(R.id.comment_picture); {
if(TextUtils.isEmpty(item.commentPicture) || item.commentPicture.equals("null")) //$NON-NLS-1$
commentPictureView.setVisibility(View.GONE);
else {
commentPictureView.setVisibility(View.VISIBLE);
commentPictureView.setUrl(item.commentPicture);
}
UpdateAdapter.setupImagePopupForCommentView(view, commentPictureView, item.commentPicture, item.title.toString(), fragment, imageCache);
}
}

@ -143,7 +143,29 @@ public class UpdateAdapter extends CursorAdapter {
final AsyncImageView commentPictureView = (AsyncImageView)view.findViewById(R.id.comment_picture); {
final String updatePicture = update.getValue(Update.PICTURE);
if (!TextUtils.isEmpty(updatePicture) && !"null".equals(updatePicture)) {
setupImagePopupForCommentView(view, commentPictureView, updatePicture,
update.getValue(Update.MESSAGE), fragment, imageCache);
}
// name
final TextView nameView = (TextView)view.findViewById(R.id.title); {
nameView.setText(getUpdateComment(update, user, linkColor, fromView));
}
// date
final TextView date = (TextView)view.findViewById(R.id.date); {
CharSequence dateString = DateUtils.getRelativeTimeSpanString(update.getValue(Update.CREATION_DATE),
DateUtilities.now(), DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_ABBREV_RELATIVE);
date.setText(dateString);
}
}
public static void setupImagePopupForCommentView(View view, AsyncImageView commentPictureView, final String updatePicture,
final String message, final Fragment fragment, ImageDiskCache imageCache) {
if (!TextUtils.isEmpty(updatePicture) && !"null".equals(updatePicture)) { //$NON-NLS-1$
commentPictureView.setVisibility(View.VISIBLE);
commentPictureView.setUrl(updatePicture);
@ -158,7 +180,6 @@ public class UpdateAdapter extends CursorAdapter {
commentPictureView.setUrl(updatePicture);
}
final String message = update.getValue(Update.MESSAGE);
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
@ -184,22 +205,6 @@ public class UpdateAdapter extends CursorAdapter {
}
}
// name
final TextView nameView = (TextView)view.findViewById(R.id.title); {
nameView.setText(getUpdateComment(update, user, linkColor, fromView));
}
// date
final TextView date = (TextView)view.findViewById(R.id.date); {
CharSequence dateString = DateUtils.getRelativeTimeSpanString(update.getValue(Update.CREATION_DATE),
DateUtilities.now(), DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_ABBREV_RELATIVE);
date.setText(dateString);
}
}
public static String linkify (String string, String linkColor) {
return String.format("<font color=%s>%s</font>", linkColor, string); //$NON-NLS-1$
}

Loading…
Cancel
Save