mirror of https://github.com/M66B/FairEmail.git
Removed image size
This commit is contained in:
parent
50eaabd59e
commit
6024db8670
|
@ -59,7 +59,6 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
|
|||
private ImageView ivImage;
|
||||
private TextView tvCaption;
|
||||
private TextView tvType;
|
||||
private TextView tvSize;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
@ -68,7 +67,6 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
|
|||
ivImage = itemView.findViewById(R.id.ivImage);
|
||||
tvCaption = itemView.findViewById(R.id.tvCaption);
|
||||
tvType = itemView.findViewById(R.id.tvType);
|
||||
tvSize = itemView.findViewById(R.id.tvSize);
|
||||
}
|
||||
|
||||
private void wire() {
|
||||
|
@ -80,9 +78,8 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
|
|||
}
|
||||
|
||||
private void bindTo(EntityAttachment attachment) {
|
||||
Bitmap bm = null;
|
||||
if (attachment.available) {
|
||||
bm = Helper.decodeImage(attachment.getFile(context),
|
||||
Bitmap bm = Helper.decodeImage(attachment.getFile(context),
|
||||
context.getResources().getDisplayMetrics().widthPixels);
|
||||
if (bm == null)
|
||||
ivImage.setImageResource(R.drawable.baseline_broken_image_24);
|
||||
|
@ -93,12 +90,9 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
|
|||
? R.drawable.baseline_image_24 : R.drawable.baseline_hourglass_empty_24);
|
||||
|
||||
tvCaption.setVisibility(TextUtils.isEmpty(attachment.name) ? View.GONE : View.VISIBLE);
|
||||
tvSize.setVisibility(bm == null ? View.GONE : View.VISIBLE);
|
||||
|
||||
tvCaption.setText(attachment.name);
|
||||
tvType.setText(attachment.type);
|
||||
if (bm != null)
|
||||
tvSize.setText(bm.getWidth() + "x" + bm.getHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,16 +45,5 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCaption" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="160x320"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvType" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
Loading…
Reference in New Issue