Search in sources :

Example 6 with CategoryAdapter

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);
}
Also used : CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter)

Example 7 with CategoryAdapter

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);
        }
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) MainPanel(com.android.gallery3d.filtershow.category.MainPanel) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) Fragment(android.support.v4.app.Fragment) MediaPickerFragment(com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment) DialogFragment(android.support.v4.app.DialogFragment) Point(android.graphics.Point)

Example 8 with CategoryAdapter

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));
        }
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) ArrayList(java.util.ArrayList) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) Point(android.graphics.Point)

Example 9 with CategoryAdapter

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));
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 10 with CategoryAdapter

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));
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) FiltersManager(com.android.gallery3d.filtershow.filters.FiltersManager) CategoryAdapter(com.android.gallery3d.filtershow.category.CategoryAdapter) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Aggregations

CategoryAdapter (com.android.gallery3d.filtershow.category.CategoryAdapter)12 Action (com.android.gallery3d.filtershow.category.Action)11 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)11 FiltersManager (com.android.gallery3d.filtershow.filters.FiltersManager)11 Point (android.graphics.Point)3 DialogFragment (android.support.v4.app.DialogFragment)1 Fragment (android.support.v4.app.Fragment)1 MainPanel (com.android.gallery3d.filtershow.category.MainPanel)1 MediaPickerFragment (com.android.gallery3d.filtershow.mediapicker.MediaPickerFragment)1 ArrayList (java.util.ArrayList)1