Search in sources :

Example 1 with FilterColorBorderRepresentation

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

the class EditorColorBorder method calculateUserMessage.

@Override
public String calculateUserMessage(Context context, String effectName, Object parameterValue) {
    FilterColorBorderRepresentation rep = getColorBorderRep();
    if (rep == null) {
        return "";
    }
    if (mParameterString == null) {
        mParameterString = "";
    }
    String paramString;
    String val = rep.getValueString();
    return mParameterString + val;
}
Also used : FilterColorBorderRepresentation(com.android.gallery3d.filtershow.filters.FilterColorBorderRepresentation)

Example 2 with FilterColorBorderRepresentation

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

the class EditorColorBorder method selectMenuItem.

protected void selectMenuItem(MenuItem item) {
    ImageFilterColorBorder filter = (ImageFilterColorBorder) mImageShow.getCurrentFilter();
    FilterColorBorderRepresentation rep = getColorBorderRep();
    if (rep == null) {
        return;
    }
    switch(item.getItemId()) {
        case R.id.color_border_menu_clear:
            clearFrame();
            break;
        case R.id.color_border_menu_size:
            rep.setPramMode(FilterColorBorderRepresentation.PARAM_SIZE);
            break;
        case R.id.color_border_menu_corner_size:
            rep.setPramMode(FilterColorBorderRepresentation.PARAM_RADIUS);
            break;
        case R.id.color_border_menu_color:
            rep.setPramMode(FilterColorBorderRepresentation.PARAM_COLOR);
            break;
    }
    if (item.getItemId() != R.id.color_border_menu_clear) {
        mParameterString = item.getTitle().toString();
    }
    if (mControl instanceof ColorChooser) {
        ColorChooser c = (ColorChooser) mControl;
        mBasColors = c.getColorSet();
    }
    if (mEditControl != null) {
        control(rep.getCurrentParam(), mEditControl);
    }
    if (mControl instanceof ColorChooser) {
        ColorChooser c = (ColorChooser) mControl;
        c.setColorSet(mBasColors);
    }
    updateText();
    if (mControl != null) {
        mControl.updateUI();
    }
    mView.invalidate();
}
Also used : FilterColorBorderRepresentation(com.android.gallery3d.filtershow.filters.FilterColorBorderRepresentation) ColorChooser(com.android.gallery3d.filtershow.controller.ColorChooser) ImageFilterColorBorder(com.android.gallery3d.filtershow.filters.ImageFilterColorBorder)

Example 3 with FilterColorBorderRepresentation

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

the class EditorColorBorder method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    super.reflectCurrentFilter();
    FilterRepresentation rep = getLocalRepresentation();
    if (rep != null && getLocalRepresentation() instanceof FilterColorBorderRepresentation) {
        FilterColorBorderRepresentation cbRep = (FilterColorBorderRepresentation) getLocalRepresentation();
        if (!ParametricEditor.useCompact(mContext)) {
            if (mTabletUI != null) {
                mTabletUI.setColorBorderRepresentation(cbRep);
            }
        }
        cbRep.setPramMode(FilterColorBorderRepresentation.PARAM_SIZE);
        mParameterString = mContext.getString(R.string.color_border_size);
        if (mEditControl != null) {
            control(cbRep.getCurrentParam(), mEditControl);
        }
    }
}
Also used : FilterColorBorderRepresentation(com.android.gallery3d.filtershow.filters.FilterColorBorderRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Aggregations

FilterColorBorderRepresentation (com.android.gallery3d.filtershow.filters.FilterColorBorderRepresentation)3 ColorChooser (com.android.gallery3d.filtershow.controller.ColorChooser)1 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)1 ImageFilterColorBorder (com.android.gallery3d.filtershow.filters.ImageFilterColorBorder)1