Browse Source

oops, better handling

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
d10e95c529
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 8
      app/src/main/java/awais/instagrabber/adapters/viewholder/feed/FeedItemViewHolder.java

8
app/src/main/java/awais/instagrabber/adapters/viewholder/feed/FeedItemViewHolder.java

@ -115,7 +115,13 @@ public abstract class FeedItemViewHolder extends RecyclerView.ViewHolder {
private void setupLocation(@NonNull final Media media) {
final Location location = media.getLocation();
if (location != null) {
if (location == null) {
topBinding.location.setVisibility(View.GONE);
topBinding.title.setLayoutParams(new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT
));
}
else {
final String locationName = location.getName();
if (TextUtils.isEmpty(locationName)) {
topBinding.location.setVisibility(View.GONE);

Loading…
Cancel
Save