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

Commit f519e3ff authored by Emily Chuang's avatar Emily Chuang
Browse files

Make ContextualCardLoader do entire loading upon fragment's onStart()

For dismissal mechanism, we will have to get information about those
dismissed cards that are stored in Card DB with flag "dismiss" to filter
them out. Currently we only do the entire loading in fragment's
onCreate(), so only when the fragment is recreated users can get the new
data. Now we are changing it to onStart() and make the loader restart so
we are able to show the latest cards.

Change-Id: I4c0be297232f026b46feb8084084816e1acc8f11
Fixes: 119090460
Bug: 113783548
Test: visual
parent 5d2a3d23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class ContextualCardManager implements ContextualCardLoader.CardContentLo
        final CardContentLoaderCallbacks cardContentLoaderCallbacks =
                new CardContentLoaderCallbacks(mContext);
        cardContentLoaderCallbacks.setListener(this);
        LoaderManager.getInstance(fragment).initLoader(CARD_CONTENT_LOADER_ID, null /* bundle */,
        LoaderManager.getInstance(fragment).restartLoader(CARD_CONTENT_LOADER_ID, null /* bundle */,
                cardContentLoaderCallbacks);
    }

+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@ public class ContextualCardsFragment extends InstrumentedFragment {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContextualCardManager = new ContextualCardManager(getContext(), getSettingsLifecycle());
    }

    @Override
    public void onStart() {
        super.onStart();
        mContextualCardManager.loadContextualCards(this);
    }