Browse Source

fix Add to favorites button's visibility - issue #1047

renovate/org.robolectric-robolectric-4.x
stamatiap 4 years ago
parent
commit
a5759b6c1b
  1. 2
      app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java

2
app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java

@ -693,6 +693,8 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
fetchStoryAndHighlights(profileId); fetchStoryAndHighlights(profileId);
} }
setupButtons(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); profileDetailsBinding.favChip.setVisibility(View.VISIBLE);
final FavoriteRepository favoriteRepository = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(getContext())); final FavoriteRepository favoriteRepository = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(getContext()));
favoriteRepository.getFavorite(profileModel.getUsername(), FavoriteType.USER, new RepositoryCallback<Favorite>() { favoriteRepository.getFavorite(profileModel.getUsername(), FavoriteType.USER, new RepositoryCallback<Favorite>() {

Loading…
Cancel
Save