From d10e95c5292a28a25b4fc3a0972ca031c8c8e5b7 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Thu, 18 Feb 2021 19:57:38 -0500 Subject: [PATCH] oops, better handling --- .../adapters/viewholder/feed/FeedItemViewHolder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/adapters/viewholder/feed/FeedItemViewHolder.java b/app/src/main/java/awais/instagrabber/adapters/viewholder/feed/FeedItemViewHolder.java index 2def1d07..860bd027 100644 --- a/app/src/main/java/awais/instagrabber/adapters/viewholder/feed/FeedItemViewHolder.java +++ b/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);