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

Commit 85ead953 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not trigger card loader reloading upon screen rotation."

parents 74d549fc 175a22c8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -108,7 +108,8 @@ public class ContextualCardManager implements ContextualCardLoader.CardContentLo
        final CardContentLoaderCallbacks cardContentLoaderCallbacks =
                new CardContentLoaderCallbacks(mContext);
        cardContentLoaderCallbacks.setListener(this);
        LoaderManager.getInstance(fragment).restartLoader(CARD_CONTENT_LOADER_ID, null /* bundle */,
        // Use the cached data when navigating back to the first page and upon screen rotation.
        LoaderManager.getInstance(fragment).initLoader(CARD_CONTENT_LOADER_ID, null /* bundle */,
                cardContentLoaderCallbacks);
    }

@@ -192,7 +193,7 @@ public class ContextualCardManager implements ContextualCardLoader.CardContentLo
        Log.d(TAG, "Total loading time = " + loadTime);
        final List<ContextualCard> cardsToKeep = getCardsToKeep(cards);

        //navigate back to the homepage or after card dismissal
        //navigate back to the homepage, screen rotate or after card dismissal
        if (!mIsFirstLaunch) {
            onContextualCardUpdated(cardsToKeep.stream()
                    .collect(groupingBy(ContextualCard::getCardType)));