Remove recycled view pool (#8616)

### Description

Remove recycled view pool. This conflicts with predictive back gestures
and doesn't have a noticeable performance impact.

### Checklist
<!-- 
To help us keep the issue tracker clean and work as efficient as
possible,
  please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
lint`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
This commit is contained in:
Hans-Peter Lehmann
2026-07-21 22:17:58 +02:00
committed by GitHub
parent 03e8351ee0
commit b7ee12ccfc
9 changed files with 0 additions and 15 deletions

View File

@ -29,7 +29,6 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentContainerView;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import androidx.work.WorkInfo;
import androidx.work.WorkManager;
import com.bumptech.glide.Glide;
@ -113,7 +112,6 @@ public class MainActivity extends CastEnabledActivity implements NavigationToolb
private LockableBottomSheetBehavior<FragmentContainerView> sheetBehavior;
private BottomSheetBackPressedCallback bottomSheetBackPressedCallback;
private OnBackPressedCallback openDefaultPageBackPressedCallback;
private final RecyclerView.RecycledViewPool recycledViewPool = new RecyclerView.RecycledViewPool();
private int lastTheme = 0;
private Insets systemBarInsets = Insets.NONE;
@ -127,7 +125,6 @@ public class MainActivity extends CastEnabledActivity implements NavigationToolb
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
recycledViewPool.setMaxRecycledViews(R.id.view_type_episode_item, 25);
checkFirstLaunch();
drawerLayout = findViewById(R.id.drawer_layout);
@ -419,10 +416,6 @@ public class MainActivity extends CastEnabledActivity implements NavigationToolb
playerContent.setPadding(systemBarInsets.left, systemBarInsets.top, systemBarInsets.right, 0);
}
public RecyclerView.RecycledViewPool getRecycledViewPool() {
return recycledViewPool;
}
public Fragment createFragmentInstance(String tag, Bundle args) {
Log.d(TAG, "loadFragment(tag: " + tag + ", args: " + args + ")");
Fragment fragment;

View File

@ -32,7 +32,6 @@ public class EpisodeItemListRecyclerView extends RecyclerView {
private void setup() {
layoutManager = new LinearLayoutManager(getContext());
layoutManager.setRecycleChildrenOnDetach(true);
setLayoutManager(layoutManager);
setHasFixedSize(true);
setClipToPadding(false);

View File

@ -159,7 +159,6 @@ public abstract class EpisodesListFragment extends Fragment
((MainActivity) getActivity()).setupToolbarToggle(toolbar, displayUpArrow);
recyclerView = root.findViewById(R.id.recyclerView);
recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool());
setupLoadMoreScrollListener();
recyclerView.addOnScrollListener(new LiftOnScrollListener(root.findViewById(R.id.appbar)));

View File

@ -151,7 +151,6 @@ public class SearchFragment extends Fragment implements EpisodeItemListAdapter.O
progressBar = layout.findViewById(R.id.progressBar);
recyclerView = layout.findViewById(R.id.recyclerView);
floatingSelectMenu = layout.findViewById(R.id.floatingSelectMenu);
recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool());
registerForContextMenu(recyclerView);
adapter = new EpisodeItemListAdapter(getActivity()) {
@Override

View File

@ -106,7 +106,6 @@ public class CompletedDownloadsFragment extends Fragment
swipeRefreshLayout.setOnRefreshListener(() -> FeedUpdateManager.getInstance().runOnceOrAsk(requireContext()));
recyclerView = root.findViewById(R.id.recyclerView);
recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool());
adapter = new CompletedDownloadsListAdapter(getActivity());
adapter.setOnSelectModeListener(this);
recyclerView.setAdapter(adapter);

View File

@ -143,7 +143,6 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
}
if (getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).setupToolbarToggle(viewBinding.toolbar, displayUpArrow);
viewBinding.recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool());
} else {
viewBinding.toolbar.setNavigationIcon(R.drawable.ic_close);
viewBinding.toolbar.setNavigationOnClickListener(view -> getActivity().finish());

View File

@ -53,7 +53,6 @@ public class DownloadsSection extends HomeSection {
viewBinding.recyclerView.setPadding(0, 0, 0, 0);
viewBinding.recyclerView.setOverScrollMode(RecyclerView.OVER_SCROLL_NEVER);
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
viewBinding.recyclerView.setRecycledViewPool(((MainActivity) requireActivity()).getRecycledViewPool());
adapter = new EpisodeItemListAdapter(requireActivity()) {
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {

View File

@ -54,7 +54,6 @@ public class InboxSection extends HomeSection {
viewBinding.recyclerView.setPadding(0, 0, 0, 0);
viewBinding.recyclerView.setOverScrollMode(RecyclerView.OVER_SCROLL_NEVER);
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
viewBinding.recyclerView.setRecycledViewPool(((MainActivity) requireActivity()).getRecycledViewPool());
adapter = new EpisodeItemListAdapter(requireActivity()) {
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {

View File

@ -435,7 +435,6 @@ public class QueueFragment extends Fragment implements MaterialToolbar.OnMenuIte
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool());
registerForContextMenu(recyclerView);
recyclerView.addOnScrollListener(new LiftOnScrollListener(root.findViewById(R.id.appbar)));