Display comment images

This commit is contained in:
Pierre 2018-04-07 18:18:46 +02:00
parent 20911e9b2a
commit 94dc614ce6
3 changed files with 18 additions and 0 deletions

View File

@ -93,6 +93,16 @@ class CommentsAdapter extends ArrayAdapter<Comment> {
//Update comment content //Update comment content
((TextView) view.findViewById(R.id.comment_text)).setText(comment.getContent()); ((TextView) view.findViewById(R.id.comment_text)).setText(comment.getContent());
//Update comment image (if any)
ImageView commentImage = view.findViewById(R.id.comment_image);
if(comment.getImage_url().length() < 5)
commentImage.setVisibility(View.GONE);
else {
commentImage.setVisibility(View.VISIBLE);
ImageLoadManager.remove(commentImage);
ImageLoadManager.load(context, comment.getImage_url(), commentImage);
}
//Update comment likes //Update comment likes
LikeButtonView like = view.findViewById(R.id.like_button); LikeButtonView like = view.findViewById(R.id.like_button);

View File

@ -32,6 +32,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="A comment content" /> tools:text="A comment content" />
<!-- Comment image -->
<ImageView
android:id="@+id/comment_image"
android:layout_width="50dp"
android:layout_height="50dp"
android:contentDescription="@string/comment_image_description"/>
<!-- Comment like button --> <!-- Comment like button -->
<org.communiquons.android.comunic.client.ui.views.LikeButtonView <org.communiquons.android.comunic.client.ui.views.LikeButtonView
android:id="@+id/like_button" android:id="@+id/like_button"

View File

@ -136,4 +136,5 @@
<string name="popup_editcomment_confirm">Edit</string> <string name="popup_editcomment_confirm">Edit</string>
<string name="popup_editcomment_edit_placeholder">New content for the comment</string> <string name="popup_editcomment_edit_placeholder">New content for the comment</string>
<string name="err_update_comment_content">An error occurred while trying to update comment content !</string> <string name="err_update_comment_content">An error occurred while trying to update comment content !</string>
<string name="comment_image_description">Comment image</string>
</resources> </resources>