Browse Source

Merge pull request #1171 from raniapl/stamatiap/fix-issue1047

fix Add to favorites button's visibility - issue #1047
renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
committed by GitHub
parent
commit
ad293b6e85
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java

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

@ -693,7 +693,6 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
fetchStoryAndHighlights(profileId);
}
setupButtons(profileId);
profileDetailsBinding.favChip.setVisibility(View.VISIBLE);
final FavoriteRepository favoriteRepository = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(getContext()));
favoriteRepository.getFavorite(profileModel.getUsername(), FavoriteType.USER, new RepositoryCallback<Favorite>() {
@Override
@ -938,6 +937,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
profileDetailsBinding.btnSaved.setVisibility(View.VISIBLE);
profileDetailsBinding.btnLiked.setVisibility(View.VISIBLE);
profileDetailsBinding.btnDM.setVisibility(View.GONE);
profileDetailsBinding.favChip.setVisibility(View.GONE);
profileDetailsBinding.btnSaved.setText(R.string.saved);
if (!accountIsUpdated) updateAccountInfo();
return;
@ -946,6 +946,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
profileDetailsBinding.btnLiked.setVisibility(View.GONE);
profileDetailsBinding.btnDM.setVisibility(disableDm ? View.GONE : View.VISIBLE);
profileDetailsBinding.btnFollow.setVisibility(View.VISIBLE);
profileDetailsBinding.favChip.setVisibility(View.VISIBLE);
final Context context = getContext();
if (context == null) return;
if (profileModel.getFriendshipStatus().isFollowing() || profileModel.getFriendshipStatus().isFollowedBy()) {

Loading…
Cancel
Save