Search in sources :

Example 1 with ColorChooser

use of com.android.gallery3d.filtershow.controller.ColorChooser 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 2 with ColorChooser

use of com.android.gallery3d.filtershow.controller.ColorChooser in project android_packages_apps_Gallery2 by LineageOS.

the class EditorDraw method selectMenuItem.

protected void selectMenuItem(MenuItem item) {
    ImageFilterDraw filter = (ImageFilterDraw) mImageShow.getCurrentFilter();
    FilterDrawRepresentation rep = getDrawRep();
    if (rep == null) {
        return;
    }
    switch(item.getItemId()) {
        case R.id.draw_menu_clear:
            clearDrawing();
            break;
        case R.id.draw_menu_size:
            rep.setPramMode(FilterDrawRepresentation.PARAM_SIZE);
            break;
        case R.id.draw_menu_style:
            rep.setPramMode(FilterDrawRepresentation.PARAM_STYLE);
            break;
        case R.id.draw_menu_color:
            rep.setPramMode(FilterDrawRepresentation.PARAM_COLOR);
            break;
    }
    if (item.getItemId() != R.id.draw_menu_clear) {
        mParameterString = item.getTitle().toString();
        updateText();
    }
    if (mControl instanceof ColorChooser) {
        ColorChooser c = (ColorChooser) mControl;
        mBasColors = c.getColorSet();
    }
    control(rep.getCurrentParam(), mEditControl);
    if (mControl instanceof ColorChooser) {
        ColorChooser c = (ColorChooser) mControl;
        c.setColorSet(mBasColors);
    }
    mControl.updateUI();
    mView.invalidate();
}
Also used : ImageFilterDraw(com.android.gallery3d.filtershow.filters.ImageFilterDraw) ColorChooser(com.android.gallery3d.filtershow.controller.ColorChooser) FilterDrawRepresentation(com.android.gallery3d.filtershow.filters.FilterDrawRepresentation)

Aggregations

ColorChooser (com.android.gallery3d.filtershow.controller.ColorChooser)2 FilterColorBorderRepresentation (com.android.gallery3d.filtershow.filters.FilterColorBorderRepresentation)1 FilterDrawRepresentation (com.android.gallery3d.filtershow.filters.FilterDrawRepresentation)1 ImageFilterColorBorder (com.android.gallery3d.filtershow.filters.ImageFilterColorBorder)1 ImageFilterDraw (com.android.gallery3d.filtershow.filters.ImageFilterDraw)1