Refactor SummaryLoader to set summary on subsetting pages.
- Make a SummaryConsumer interface. Things that needs latest summary should implement this interface (DashboardAdapter for homepage, DashboardFragment for subsettings). This also decouples SummaryLoader from relying on SettingsDrawerActivity. - Make DashboardFeatureProvider more generic to load DashboardCategory by key. Bug: 31781480 Test: RunSettingsRoboTests Change-Id: I9c65456fb433a74c352498251e0ccf65da0be1f0
This commit is contained in:
@@ -48,7 +48,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.DashboardItemHolder>
|
||||
implements View.OnClickListener {
|
||||
implements View.OnClickListener, SummaryLoader.SummaryConsumer {
|
||||
public static final String TAG = "DashboardAdapter";
|
||||
private static final String STATE_SUGGESTION_LIST = "suggestion_list";
|
||||
private static final String STATE_CATEGORY_LIST = "category_list";
|
||||
@@ -141,11 +141,8 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
|
||||
recountItems();
|
||||
}
|
||||
|
||||
public boolean isShowingAll() {
|
||||
return mIsShowingAll;
|
||||
}
|
||||
|
||||
public void notifyChanged(Tile tile) {
|
||||
@Override
|
||||
public void notifySummaryChanged(Tile tile) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user