use of com.android.gallery3d.filtershow.category.CategoryAdapter in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillVersions.
private void fillVersions() {
if (mCategoryVersionsAdapter != null) {
mCategoryVersionsAdapter.clear();
}
mCategoryVersionsAdapter = new CategoryAdapter(this);
mCategoryVersionsAdapter.setShowAddButton(true);
}
use of com.android.gallery3d.filtershow.category.CategoryAdapter in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillLooks.
private void fillLooks() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getLooks();
if (mCategoryLooksAdapter != null) {
mCategoryLooksAdapter.clear();
}
mCategoryLooksAdapter = new CategoryAdapter(this);
int verticalItemHeight = (int) getResources().getDimension(R.dimen.action_item_height);
mCategoryLooksAdapter.setItemHeight(verticalItemHeight);
for (FilterRepresentation representation : filtersRepresentations) {
mCategoryLooksAdapter.add(new Action(this, representation, Action.FULL_VIEW));
}
if (FilterGeneratorNativeEngine.getInstance().isLibLoaded()) {
if (mUserPresetsManager.getRepresentations() == null || mUserPresetsManager.getRepresentations().size() == 0) {
mCategoryLooksAdapter.add(new Action(this, Action.ADD_ACTION));
}
}
fillPresetFilter();
Fragment panel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (panel != null) {
if (panel instanceof MainPanel) {
MainPanel mainPanel = (MainPanel) panel;
mainPanel.loadCategoryLookPanel(true);
}
}
}
use of com.android.gallery3d.filtershow.category.CategoryAdapter in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillWaterMarks.
private void fillWaterMarks() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<ArrayList<FilterRepresentation>> filters = new ArrayList<>();
filters.add(filtersManager.getWaterMarks());
filters.add(filtersManager.getLocations());
filters.add(filtersManager.getTimes());
filters.add(filtersManager.getWeathers());
filters.add(filtersManager.getEmotions());
filters.add(filtersManager.getFoods());
if (mCategoryWatermarkAdapters != null) {
mCategoryWatermarkAdapters.clear();
}
mCategoryWatermarkAdapters = new ArrayList<>();
for (int i = 0; i < filters.size(); i++) {
mCategoryWatermarkAdapters.add(new CategoryAdapter(this));
for (FilterRepresentation representation : filters.get(i)) {
mCategoryWatermarkAdapters.get(i).add(new Action(this, representation));
}
}
}
use of com.android.gallery3d.filtershow.category.CategoryAdapter in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillTools.
private void fillTools() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getTools();
if (mCategoryGeometryAdapter != null) {
mCategoryGeometryAdapter.clear();
}
mCategoryGeometryAdapter = new CategoryAdapter(this);
for (FilterRepresentation representation : filtersRepresentations) {
mCategoryGeometryAdapter.add(new Action(this, representation));
}
}
use of com.android.gallery3d.filtershow.category.CategoryAdapter in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillHazeBuster.
private void fillHazeBuster() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> hazeBusterRepresentations = filtersManager.getHazeBuster();
if (mCategoryHazeBusterAdapter != null) {
mCategoryHazeBusterAdapter.clear();
}
mCategoryHazeBusterAdapter = new CategoryAdapter(this);
for (FilterRepresentation representation : hazeBusterRepresentations) {
if (representation.getTextId() != 0) {
representation.setName(getString(representation.getTextId()));
}
mCategoryHazeBusterAdapter.add(new Action(this, representation));
}
}
Aggregations