From c3a3daf569d2949c52ab885eb1490906c1926d83 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sat, 10 Jul 2021 18:02:58 -0400 Subject: [PATCH] remove redundant setRefreshing() --- .../instagrabber/fragments/CollectionPostsFragment.java | 1 - .../awais/instagrabber/fragments/HashTagFragment.java | 1 - .../awais/instagrabber/fragments/LocationFragment.java | 1 - .../awais/instagrabber/fragments/PostViewV2Fragment.java | 9 ++++----- .../awais/instagrabber/fragments/main/FeedFragment.java | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/CollectionPostsFragment.java b/app/src/main/java/awais/instagrabber/fragments/CollectionPostsFragment.java index 1fddad35..450ca951 100644 --- a/app/src/main/java/awais/instagrabber/fragments/CollectionPostsFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/CollectionPostsFragment.java @@ -458,7 +458,6 @@ public class CollectionPostsFragment extends Fragment implements SwipeRefreshLay .setFeedItemCallback(feedItemCallback) .setSelectionModeCallback(selectionModeCallback) .init(); - binding.swipeRefreshLayout.setRefreshing(true); } private void updateSwipeRefreshState() { diff --git a/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java b/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java index aa28fb3e..a8198406 100644 --- a/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java @@ -370,7 +370,6 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe .setFeedItemCallback(feedItemCallback) .setSelectionModeCallback(selectionModeCallback) .init(); - binding.swipeRefreshLayout.setRefreshing(true); binding.posts.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull final RecyclerView recyclerView, final int dx, final int dy) { diff --git a/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java b/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java index 3d552324..b7e9960f 100644 --- a/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java @@ -350,7 +350,6 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR .setFeedItemCallback(feedItemCallback) .setSelectionModeCallback(selectionModeCallback) .init(); - binding.swipeRefreshLayout.setRefreshing(true); binding.posts.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull final RecyclerView recyclerView, final int dx, final int dy) { diff --git a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java index 03018093..7964e683 100644 --- a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java @@ -758,15 +758,14 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme popupMenu.setOnMenuItemClickListener(item -> { final int itemId = item.getItemId(); if (itemId == R.id.share_dm) { - if (profileModel.isPrivate()) { - Toast.makeText(context, R.string.share_private_post, Toast.LENGTH_SHORT).show(); - final UserSearchNavGraphDirections.ActionGlobalUserSearch actionGlobalUserSearch = UserSearchFragmentDirections - .actionGlobalUserSearch() + if (profileModel.isPrivate()) Toast.makeText(context, R.string.share_private_post, Toast.LENGTH_SHORT).show(); + final PostViewV2FragmentDirections.ActionToUserSearch actionGlobalUserSearch = PostViewV2FragmentDirections + .actionToUserSearch() .setTitle(getString(R.string.share)) .setActionLabel(getString(R.string.send)) .setShowGroups(true) .setMultiple(true) - .setSearchMode(UserSearchFragment.SearchMode.RAVEN); + .setSearchMode(UserSearchMode.RAVEN); final NavController navController = NavHostFragment.findNavController(PostViewV2Fragment.this); try { navController.navigate(actionGlobalUserSearch); diff --git a/app/src/main/java/awais/instagrabber/fragments/main/FeedFragment.java b/app/src/main/java/awais/instagrabber/fragments/main/FeedFragment.java index a5a3e41f..39dcbbdd 100644 --- a/app/src/main/java/awais/instagrabber/fragments/main/FeedFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/main/FeedFragment.java @@ -345,7 +345,6 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre .setFeedItemCallback(feedItemCallback) .setSelectionModeCallback(selectionModeCallback) .init(); - binding.feedSwipeRefreshLayout.setRefreshing(true); binding.feedRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull final RecyclerView recyclerView, final int dx, final int dy) {