Make Accidental Pull Down Refresh less likely (#5281)

This commit is contained in:
vbh 2021-08-12 17:18:35 +00:00 committed by GitHub
parent 2d6fff4182
commit 06713ded88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 0 deletions

View File

@ -204,6 +204,7 @@ public abstract class EpisodesListFragment extends Fragment {
}
SwipeRefreshLayout swipeRefreshLayout = root.findViewById(R.id.swipeRefresh);
swipeRefreshLayout.setDistanceToTriggerSync(getResources().getInteger(R.integer.swipe_refresh_distance));
swipeRefreshLayout.setOnRefreshListener(() -> {
AutoUpdateManager.runImmediate(requireContext());
new Handler(Looper.getMainLooper()).postDelayed(() -> swipeRefreshLayout.setRefreshing(false),

View File

@ -223,6 +223,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
EventBus.getDefault().register(this);
SwipeRefreshLayout swipeRefreshLayout = root.findViewById(R.id.swipeRefresh);
swipeRefreshLayout.setDistanceToTriggerSync(getResources().getInteger(R.integer.swipe_refresh_distance));
swipeRefreshLayout.setOnRefreshListener(() -> {
try {
DBTasks.forceRefreshFeed(requireContext(), feed, true);

View File

@ -452,6 +452,7 @@ public class QueueFragment extends Fragment implements Toolbar.OnMenuItemClickLi
registerForContextMenu(recyclerView);
SwipeRefreshLayout swipeRefreshLayout = root.findViewById(R.id.swipeRefresh);
swipeRefreshLayout.setDistanceToTriggerSync(getResources().getInteger(R.integer.swipe_refresh_distance));
swipeRefreshLayout.setOnRefreshListener(() -> {
AutoUpdateManager.runImmediate(requireContext());
new Handler(Looper.getMainLooper()).postDelayed(() -> swipeRefreshLayout.setRefreshing(false),

View File

@ -148,6 +148,7 @@ public class SubscriptionFragment extends Fragment implements Toolbar.OnMenuItem
feedsFilteredMsg.setOnClickListener((l) -> SubscriptionsFilterDialog.showDialog(requireContext()));
SwipeRefreshLayout swipeRefreshLayout = root.findViewById(R.id.swipeRefresh);
swipeRefreshLayout.setDistanceToTriggerSync(getResources().getInteger(R.integer.swipe_refresh_distance));
swipeRefreshLayout.setOnRefreshListener(() -> {
AutoUpdateManager.runImmediate(requireContext());
new Handler(Looper.getMainLooper()).postDelayed(() -> swipeRefreshLayout.setRefreshing(false),

View File

@ -3,4 +3,5 @@
<integer name="subscriptions_default_num_of_columns">3</integer>
<integer name="nav_drawer_screen_size_percent">80</integer>
<integer name="swipe_to_refresh_duration_in_ms">750</integer>
<integer name="swipe_refresh_distance">300</integer>
</resources>