Use DashboardFeatureProvider to load homepage tiles.

Adding support to homepage category.

Test: SettingsRoboTests for regression. Will write tests for new feature
soon once we are set on the data structure.
Bug: 31781480

Change-Id: I25fa367fecb643f17e23f0182df7585bf1fcdd02
This commit is contained in:
Fan Zhang
2016-09-27 17:51:11 -07:00
parent 43d4c41c8b
commit a96a2d8d60
9 changed files with 185 additions and 39 deletions

View File

@@ -18,14 +18,38 @@ package com.android.settings.dashboard;
import android.content.Context;
import com.android.settingslib.drawer.CategoryKey;
import com.android.settingslib.drawer.CategoryManager;
import com.android.settingslib.drawer.DashboardCategory;
import java.util.List;
/**
* Impl for {@code DashboardFeatureProvider}.
*/
public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
protected final Context mContext;
private final CategoryManager mCategoryManager;
public DashboardFeatureProviderImpl(Context context) {
mContext = context;
mCategoryManager = CategoryManager.get();
}
@Override
public boolean shouldUseNewIALayout(Context context) {
public boolean isEnabled() {
return false;
}
@Override
public DashboardCategory getTilesForHomepage() {
return mCategoryManager.getTilesByCategory(mContext, CategoryKey.CATEGORY_HOMEPAGE);
}
@Override
public List<DashboardCategory> getAllCategories() {
return mCategoryManager.getCategories(mContext);
}
}