From e449594253eef69f59e5ef34ede6aaef7d100cf6 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Thu, 19 Nov 2020 02:41:30 +0900 Subject: [PATCH] Fix ProfileFragment for anon users --- .../instagrabber/fragments/main/ProfileFragment.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 86fdd839..829941ab 100644 --- a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java @@ -628,11 +628,10 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe return true; }); } - if (!profileModel.isReallyPrivate() && isLoggedIn) { - profileDetailsBinding.mainFollowing.setClickable(true); - profileDetailsBinding.mainFollowers.setClickable(true); - + if (!profileModel.isReallyPrivate()) { if (isLoggedIn) { + profileDetailsBinding.mainFollowing.setClickable(true); + profileDetailsBinding.mainFollowers.setClickable(true); final View.OnClickListener followClickListener = v -> { final NavDirections action = ProfileFragmentDirections.actionProfileFragmentToFollowViewerFragment( profileId, @@ -640,11 +639,9 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe profileModel.getUsername()); NavHostFragment.findNavController(this).navigate(action); }; - profileDetailsBinding.mainFollowers.setOnClickListener(followersCount > 0 ? followClickListener : null); profileDetailsBinding.mainFollowing.setOnClickListener(followingCount > 0 ? followClickListener : null); } - binding.swipeRefreshLayout.setRefreshing(true); binding.postsRecyclerView.setVisibility(View.VISIBLE); fetchPosts();