Search in sources :

Example 1 with FilterDrawRepresentation

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

the class EditorDraw method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    super.reflectCurrentFilter();
    FilterRepresentation rep = getLocalRepresentation();
    if (rep != null && getLocalRepresentation() instanceof FilterDrawRepresentation) {
        FilterDrawRepresentation drawRep = (FilterDrawRepresentation) getLocalRepresentation();
        mImageDraw.setFilterDrawRepresentation(drawRep);
        if (!ParametricEditor.useCompact(mContext)) {
            if (mTabletUI != null) {
                mTabletUI.setDrawRepresentation(drawRep);
            }
            return;
        }
        drawRep.getParam(FilterDrawRepresentation.PARAM_STYLE).setFilterView(this);
        drawRep.setPramMode(FilterDrawRepresentation.PARAM_COLOR);
        mParameterString = mContext.getString(R.string.draw_color);
        control(drawRep.getCurrentParam(), mEditControl);
    }
}
Also used : FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) FilterDrawRepresentation(com.android.gallery3d.filtershow.filters.FilterDrawRepresentation)

Example 2 with FilterDrawRepresentation

use of com.android.gallery3d.filtershow.filters.FilterDrawRepresentation 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)

Example 3 with FilterDrawRepresentation

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

the class EditorDraw method calculateUserMessage.

@Override
public String calculateUserMessage(Context context, String effectName, Object parameterValue) {
    FilterDrawRepresentation rep = getDrawRep();
    if (mDrawString != null) {
        mImageDraw.displayDrawLook();
        return mDrawString;
    }
    if (rep == null) {
        return "";
    }
    if (!ParametricEditor.useCompact(mContext)) {
    }
    if (mParameterString == null) {
        mParameterString = "";
    }
    String paramString;
    String val = rep.getValueString();
    mImageDraw.displayDrawLook();
    return mParameterString + val;
}
Also used : FilterDrawRepresentation(com.android.gallery3d.filtershow.filters.FilterDrawRepresentation)

Aggregations

FilterDrawRepresentation (com.android.gallery3d.filtershow.filters.FilterDrawRepresentation)3 ColorChooser (com.android.gallery3d.filtershow.controller.ColorChooser)1 FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)1 ImageFilterDraw (com.android.gallery3d.filtershow.filters.ImageFilterDraw)1