diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java index 52db03c..d7bb2be 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java @@ -93,6 +93,16 @@ class CommentsAdapter extends ArrayAdapter { //Update comment content ((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 LikeButtonView like = view.findViewById(R.id.like_button); diff --git a/app/src/main/res/layout/comment_item.xml b/app/src/main/res/layout/comment_item.xml index baa95c2..b47fdf2 100644 --- a/app/src/main/res/layout/comment_item.xml +++ b/app/src/main/res/layout/comment_item.xml @@ -31,6 +31,13 @@ android:layout_weight="2" android:layout_height="wrap_content" tools:text="A comment content" /> + + + Edit New content for the comment An error occurred while trying to update comment content ! + Comment image