Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcab1eaf authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

Correctly remove ViewPager views

We were not removing them from the parent in the adapter's
destroyItem method.

Bug: 134699139
Change-Id: Ida728182da06ba4b4dc148e82762070dd0b97771
parent d3a582a9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -88,7 +88,11 @@ public class BasePreviewAdapter<T extends PreviewPage> extends PagerAdapter {
    @Override
    public void destroyItem(@NonNull ViewGroup container, int position,
            @NonNull Object object) {
        ((T) object).card = null;
        View card = ((PreviewPage) object).card;
        ((PreviewPage) object).card = null;
        if (card.getParent() == container) {
            container.removeView(card);
        }
    }

    /**