Search in sources :

Example 1 with PreviewCircleDrawable

use of com.aviary.android.feather.graphics.PreviewCircleDrawable in project mobile-android by photo.

the class SpotDrawPanel method onActivate.

/*
	 * (non-Javadoc)
	 * 
	 * @see com.aviary.android.feather.effects.AbstractEffectPanel#onActivate()
	 */
@Override
public void onActivate() {
    super.onActivate();
    ((ImageViewSpotDraw) mImageView).setOnDrawStartListener(this);
    mBackgroundDrawThread.start();
    mBackgroundDrawThread.setRadius((float) Math.max(1, mBrushSizes[0]), mPreviewWidth);
    updateSelection((View) mGallery.getSelectedView(), mGallery.getSelectedItemPosition());
    mToast = IToast.make(getContext().getBaseContext(), -1);
    mCircleDrawablePreview = new PreviewCircleDrawable(0);
    ImageView image = (ImageView) mToast.getView().findViewById(R.id.size_preview_image);
    image.setImageDrawable(mCircleDrawablePreview);
    mLensButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // boolean selected = arg0.isSelected();
            setSelectedTool(((ImageViewSpotDraw) mImageView).getDrawMode() == TouchMode.DRAW ? TouchMode.IMAGE : TouchMode.DRAW);
        }
    });
    mLensButton.setVisibility(View.VISIBLE);
    contentReady();
}
Also used : PreviewCircleDrawable(com.aviary.android.feather.graphics.PreviewCircleDrawable) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(com.aviary.android.feather.widget.AdapterView) ImageViewSpotDraw(com.aviary.android.feather.widget.ImageViewSpotDraw)

Example 2 with PreviewCircleDrawable

use of com.aviary.android.feather.graphics.PreviewCircleDrawable in project mobile-android by photo.

the class DrawingPanel method initToast.

/**
	 * Inits the toast.
	 */
private void initToast() {
    mToast = IToast.make(getContext().getBaseContext(), -1);
    mCircleDrawablePreview = new PreviewCircleDrawable(0);
    mCircleDrawablePreview.setStyle(Paint.Style.FILL);
    ImageView image = (ImageView) mToast.getView().findViewById(R.id.size_preview_image);
    image.setImageDrawable(mCircleDrawablePreview);
}
Also used : PreviewCircleDrawable(com.aviary.android.feather.graphics.PreviewCircleDrawable) ImageView(android.widget.ImageView)

Example 3 with PreviewCircleDrawable

use of com.aviary.android.feather.graphics.PreviewCircleDrawable in project mobile-android by photo.

the class DelayedSpotDrawPanel method onActivate.

/*
	 * (non-Javadoc)
	 * 
	 * @see com.aviary.android.feather.effects.AbstractEffectPanel#onActivate()
	 */
@Override
public void onActivate() {
    super.onActivate();
    disableHapticIsNecessary(mGallery);
    ((ImageViewSpotDraw) mImageView).setOnDrawStartListener(this);
    mBackgroundDrawThread.start();
    mBackgroundDrawThread.setRadius((float) Math.max(1, mBrushSizes[0]), mPreview.getWidth());
    mToast = IToast.make(getContext().getBaseContext(), -1);
    mCircleDrawablePreview = new PreviewCircleDrawable(0);
    ImageView image = (ImageView) mToast.getView().findViewById(R.id.size_preview_image);
    image.setImageDrawable(mCircleDrawablePreview);
    mLensButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // boolean selected = arg0.isSelected();
            setSelectedTool(((ImageViewSpotDraw) mImageView).getDrawMode() == TouchMode.DRAW ? TouchMode.IMAGE : TouchMode.DRAW);
        }
    });
    mLensButton.setVisibility(View.VISIBLE);
    // TODO: check if selection is correct when panel opens
    // updateSelection( (View) mGallery.getSelectedView(), mGallery.getSelectedItemPosition() );
    contentReady();
}
Also used : PreviewCircleDrawable(com.aviary.android.feather.graphics.PreviewCircleDrawable) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(com.aviary.android.feather.widget.AdapterView) ImageViewSpotDraw(com.aviary.android.feather.widget.ImageViewSpotDraw)

Aggregations

ImageView (android.widget.ImageView)3 PreviewCircleDrawable (com.aviary.android.feather.graphics.PreviewCircleDrawable)3 View (android.view.View)2 OnClickListener (android.view.View.OnClickListener)2 AdapterView (com.aviary.android.feather.widget.AdapterView)2 ImageViewSpotDraw (com.aviary.android.feather.widget.ImageViewSpotDraw)2