Can enlarge comments images.

This commit is contained in:
Pierre HUBERT 2018-07-19 08:08:23 +02:00
parent 8a1a3050f4
commit 56521b1106
2 changed files with 4 additions and 4 deletions

View File

@ -15,6 +15,7 @@ import org.communiquons.android.comunic.client.data.models.UserInfo;
import org.communiquons.android.comunic.client.data.models.Comment; import org.communiquons.android.comunic.client.data.models.Comment;
import org.communiquons.android.comunic.client.ui.listeners.onPostUpdateListener; import org.communiquons.android.comunic.client.ui.listeners.onPostUpdateListener;
import org.communiquons.android.comunic.client.ui.utils.UiUtils; import org.communiquons.android.comunic.client.ui.utils.UiUtils;
import org.communiquons.android.comunic.client.ui.views.EnlargeableWebImageView;
import org.communiquons.android.comunic.client.ui.views.LikeButtonView; import org.communiquons.android.comunic.client.ui.views.LikeButtonView;
import java.util.ArrayList; import java.util.ArrayList;
@ -90,13 +91,12 @@ class CommentsAdapter extends ArrayAdapter<Comment> {
((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) //Update comment image (if any)
ImageView commentImage = view.findViewById(R.id.comment_image); EnlargeableWebImageView commentImage = view.findViewById(R.id.comment_image);
if(comment.getImage_url().length() < 5) if(comment.getImage_url().length() < 5)
commentImage.setVisibility(View.GONE); commentImage.setVisibility(View.GONE);
else { else {
commentImage.setVisibility(View.VISIBLE); commentImage.setVisibility(View.VISIBLE);
ImageLoadHelper.remove(commentImage); commentImage.loadURL(comment.getImage_url());
ImageLoadHelper.load(context, comment.getImage_url(), commentImage);
} }

View File

@ -33,7 +33,7 @@
tools:text="A comment content" /> tools:text="A comment content" />
<!-- Comment image --> <!-- Comment image -->
<ImageView <org.communiquons.android.comunic.client.ui.views.EnlargeableWebImageView
android:id="@+id/comment_image" android:id="@+id/comment_image"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"