Search in sources :

Example 11 with Action

use of com.android.gallery3d.filtershow.category.Action 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 12 with Action

use of com.android.gallery3d.filtershow.category.Action 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 13 with Action

use of com.android.gallery3d.filtershow.category.Action 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 14 with Action

use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method loadActions.

private void loadActions() {
    for (int i = 0; i < mActions.size(); i++) {
        Action action = mActions.get(i);
        action.setImageFrame(new Rect(0, 0, 96, 96), 0);
    }
}
Also used : Action(com.android.gallery3d.filtershow.category.Action) Rect(android.graphics.Rect) Point(android.graphics.Point)

Example 15 with Action

use of com.android.gallery3d.filtershow.category.Action 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

Action (com.android.gallery3d.filtershow.category.Action)20 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)12 FiltersManager (com.android.gallery3d.filtershow.filters.FiltersManager)12 CategoryAdapter (com.android.gallery3d.filtershow.category.CategoryAdapter)11 Point (android.graphics.Point)8 Rect (android.graphics.Rect)2 FilterPresetSource (com.android.gallery3d.filtershow.data.FilterPresetSource)2 SaveOption (com.android.gallery3d.filtershow.data.FilterPresetSource.SaveOption)2 FilterPresetRepresentation (com.android.gallery3d.filtershow.filters.FilterPresetRepresentation)2 FilterUserPresetRepresentation (com.android.gallery3d.filtershow.filters.FilterUserPresetRepresentation)2 ImagePreset (com.android.gallery3d.filtershow.pipeline.ImagePreset)2 ArrayList (java.util.ArrayList)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 Uri (android.net.Uri)1 DialogFragment (android.support.v4.app.DialogFragment)1 Fragment (android.support.v4.app.Fragment)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 EditText (android.widget.EditText)1