mirror of
				https://github.com/pierre42100/ComunicAndroid
				synced 2025-11-04 11:34:06 +00:00 
			
		
		
		
	Display comment images
This commit is contained in:
		@@ -93,6 +93,16 @@ class CommentsAdapter extends ArrayAdapter<Comment> {
 | 
			
		||||
        //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);
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,13 @@
 | 
			
		||||
        android:layout_weight="2"
 | 
			
		||||
        android:layout_height="wrap_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 -->
 | 
			
		||||
    <org.communiquons.android.comunic.client.ui.views.LikeButtonView
 | 
			
		||||
 
 | 
			
		||||
@@ -136,4 +136,5 @@
 | 
			
		||||
    <string name="popup_editcomment_confirm">Edit</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="comment_image_description">Comment image</string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user