Show picture popups in task activity feed

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

@ -303,7 +303,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
this.addView(notesView); this.addView(notesView);
} }
if ( items.size() > commentItems) { if (items.size() > commentItems) {
Button loadMore = new Button(getContext()); Button loadMore = new Button(getContext());
loadMore.setText(R.string.TEA_load_more); loadMore.setText(R.string.TEA_load_more);
loadMore.setBackgroundColor(Color.alpha(0)); loadMore.setBackgroundColor(Color.alpha(0));
@ -368,12 +368,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
// picture // picture
final AsyncImageView commentPictureView = (AsyncImageView)view.findViewById(R.id.comment_picture); { final AsyncImageView commentPictureView = (AsyncImageView)view.findViewById(R.id.comment_picture); {
if(TextUtils.isEmpty(item.commentPicture) || item.commentPicture.equals("null")) //$NON-NLS-1$ UpdateAdapter.setupImagePopupForCommentView(view, commentPictureView, item.commentPicture, item.title.toString(), fragment, imageCache);
commentPictureView.setVisibility(View.GONE);
else {
commentPictureView.setVisibility(View.VISIBLE);
commentPictureView.setUrl(item.commentPicture);
}
} }
} }

@ -143,7 +143,29 @@ public class UpdateAdapter extends CursorAdapter {
final AsyncImageView commentPictureView = (AsyncImageView)view.findViewById(R.id.comment_picture); { final AsyncImageView commentPictureView = (AsyncImageView)view.findViewById(R.id.comment_picture); {
final String updatePicture = update.getValue(Update.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.setVisibility(View.VISIBLE);
commentPictureView.setUrl(updatePicture); commentPictureView.setUrl(updatePicture);
@ -158,7 +180,6 @@ public class UpdateAdapter extends CursorAdapter {
commentPictureView.setUrl(updatePicture); commentPictureView.setUrl(updatePicture);
} }
final String message = update.getValue(Update.MESSAGE);
view.setOnClickListener(new OnClickListener() { view.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { 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) { public static String linkify (String string, String linkColor) {
return String.format("<font color=%s>%s</font>", linkColor, string); //$NON-NLS-1$ return String.format("<font color=%s>%s</font>", linkColor, string); //$NON-NLS-1$
} }

Loading…
Cancel
Save