From a5759b6c1bf1665f0dbd6db5df671169f7ed136f Mon Sep 17 00:00:00 2001 From: stamatiap Date: Tue, 27 Apr 2021 12:49:08 +0300 Subject: [PATCH] fix Add to favorites button's visibility - issue #1047 --- .../java/awais/instagrabber/fragments/main/ProfileFragment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java index 15181356..69266a70 100644 --- a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java @@ -693,6 +693,8 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe fetchStoryAndHighlights(profileId); } setupButtons(profileId); + final boolean isNotMe = profileModel != null && !Objects.equals(profileId, myId); + profileDetailsBinding.favChip.setVisibility(isNotMe ? View.VISIBLE : View.GONE); profileDetailsBinding.favChip.setVisibility(View.VISIBLE); final FavoriteRepository favoriteRepository = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(getContext())); favoriteRepository.getFavorite(profileModel.getUsername(), FavoriteType.USER, new RepositoryCallback() {