Refactoring

pull/194/merge
M66B 4 years ago
parent 69258b092d
commit 982b156a20

@ -81,6 +81,9 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
} }
private void bindTo(EntityAttachment attachment) { private void bindTo(EntityAttachment attachment) {
tvCaption.setText(attachment.name);
tvCaption.setVisibility(TextUtils.isEmpty(attachment.name) ? View.GONE : View.VISIBLE);
if (attachment.available) { if (attachment.available) {
if (BuildConfig.DEBUG && if (BuildConfig.DEBUG &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
@ -106,10 +109,6 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
} else } else
ivImage.setImageResource(attachment.progress == null ivImage.setImageResource(attachment.progress == null
? R.drawable.twotone_image_24 : R.drawable.twotone_hourglass_top_24); ? R.drawable.twotone_image_24 : R.drawable.twotone_hourglass_top_24);
tvCaption.setVisibility(TextUtils.isEmpty(attachment.name) ? View.GONE : View.VISIBLE);
tvCaption.setText(attachment.name);
} }
@Override @Override

Loading…
Cancel
Save