|
|
|
@ -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$
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|