Search in sources :

Example 61 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class UserPresetsAdapter method deletePreset.

private void deletePreset(Action action) {
    FilterRepresentation rep = action.getRepresentation();
    if (rep instanceof FilterUserPresetRepresentation) {
        mDeletedRepresentations.add((FilterUserPresetRepresentation) rep);
    }
    remove(action);
    notifyDataSetChanged();
}
Also used : FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) FilterUserPresetRepresentation(com.android.gallery3d.filtershow.filters.FilterUserPresetRepresentation)

Example 62 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class StateAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    StateView view = null;
    if (convertView == null) {
        convertView = new StateView(getContext());
    }
    view = (StateView) convertView;
    State state = getItem(position);
    view.setState(state);
    view.setOrientation(mOrientation);
    FilterRepresentation currentRep = MasterImage.getImage().getCurrentFilterRepresentation();
    FilterRepresentation stateRep = state.getFilterRepresentation();
    if (currentRep != null && stateRep != null && currentRep.getFilterClass() == stateRep.getFilterClass() && currentRep.getEditorId() != ImageOnlyEditor.ID) {
        view.setSelected(true);
    } else {
        view.setSelected(false);
    }
    return view;
}
Also used : FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 63 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class StateAdapter method remove.

@Override
public void remove(State state) {
    super.remove(state);
    FilterRepresentation filterRepresentation = state.getFilterRepresentation();
    FilterShowActivity activity = (FilterShowActivity) getContext();
    activity.removeFilterRepresentation(filterRepresentation);
}
Also used : FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) FilterShowActivity(com.android.gallery3d.filtershow.FilterShowActivity)

Example 64 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class Editor method reflectCurrentFilter.

/**
 * called after the filter is set and the select is called
 */
public void reflectCurrentFilter() {
    mLocalRepresentation = null;
    FilterRepresentation representation = getLocalRepresentation();
    if (representation != null && mFilterTitle != null && representation.getTextId() != 0) {
        String text = mContext.getString(representation.getTextId()).toUpperCase();
        mFilterTitle.setText(text);
        updateText();
    }
}
Also used : FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 65 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class Editor method getLocalRepresentation.

public FilterRepresentation getLocalRepresentation() {
    if (mLocalRepresentation == null) {
        ImagePreset preset = MasterImage.getImage().getPreset();
        FilterRepresentation filterRepresentation = MasterImage.getImage().getCurrentFilterRepresentation();
        mLocalRepresentation = preset.getFilterRepresentationCopyFrom(filterRepresentation);
        if (mShowParameter == SHOW_VALUE_UNDEFINED && filterRepresentation != null) {
            boolean show = filterRepresentation.showParameterValue();
            mShowParameter = show ? SHOW_VALUE_INT : SHOW_VALUE_OFF;
        }
    }
    return mLocalRepresentation;
}
Also used : ImagePreset(com.android.gallery3d.filtershow.pipeline.ImagePreset) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Aggregations

FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)78 Action (com.android.gallery3d.filtershow.category.Action)12 FiltersManager (com.android.gallery3d.filtershow.filters.FiltersManager)12 CategoryAdapter (com.android.gallery3d.filtershow.category.CategoryAdapter)11 Point (android.graphics.Point)8 ImagePreset (com.android.gallery3d.filtershow.pipeline.ImagePreset)8 Bitmap (android.graphics.Bitmap)7 FilterUserPresetRepresentation (com.android.gallery3d.filtershow.filters.FilterUserPresetRepresentation)6 FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)5 FilterDualCamFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation)5 FilterMirrorRepresentation (com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation)5 MasterImage (com.android.gallery3d.filtershow.imageshow.MasterImage)5 FilterGradRepresentation (com.android.gallery3d.filtershow.filters.FilterGradRepresentation)4 FilterRotateRepresentation (com.android.gallery3d.filtershow.filters.FilterRotateRepresentation)4 ArrayList (java.util.ArrayList)4 Uri (android.net.Uri)3 LayoutInflater (android.view.LayoutInflater)3 View (android.view.View)3 OnClickListener (android.view.View.OnClickListener)3 FilterCropRepresentation (com.android.gallery3d.filtershow.filters.FilterCropRepresentation)3