Search in sources :

Example 1 with ConfigService

use of com.aviary.android.feather.library.services.ConfigService in project mobile-android by photo.

the class AdjustEffectPanel method onCreate.

/*
	 * (non-Javadoc)
	 * 
	 * @see com.aviary.android.feather.effects.AbstractEffectPanel#onCreate(android.graphics.Bitmap)
	 */
@Override
public void onCreate(Bitmap bitmap) {
    super.onCreate(bitmap);
    ConfigService config = getContext().getService(ConfigService.class);
    if (null != config) {
        animDuration = config.getInteger(R.integer.feather_adjust_tool_anim_time);
        resetAnimDuration = config.getInteger(R.integer.feather_adjust_tool_reset_anim_time);
        enable3DAnimation = config.getBoolean(R.integer.feather_adjust_tool_enable_3d_flip);
        enableFreeRotate = config.getBoolean(R.integer.feather_rotate_enable_free_rotate);
    } else {
        enable3DAnimation = false;
        enableFreeRotate = false;
    }
    mView = (AdjustImageView) getContentView().findViewById(R.id.image);
    mView.setResetAnimDuration(resetAnimDuration);
    mView.setCameraEnabled(enable3DAnimation);
    mView.setEnableFreeRotate(enableFreeRotate);
}
Also used : ConfigService(com.aviary.android.feather.library.services.ConfigService)

Example 2 with ConfigService

use of com.aviary.android.feather.library.services.ConfigService in project mobile-android by photo.

the class BordersPanel method onActivate.

@Override
public void onActivate() {
    super.onActivate();
    ConfigService config = getContext().getService(ConfigService.class);
    // new method, using the panel height dinamically
    mFilterCellWidth = (int) ((getOptionView().findViewById(R.id.background).getHeight() - getOptionView().findViewById(R.id.bottom_background_overlay).getHeight()) * 0.9);
    mThumbBitmapSize = (int) (mFilterCellWidth * 0.85);
    // mFilterCellWidth = config.getDimensionPixelSize( R.dimen.feather_effects_cell_width );
    // mFilterCellWidth = (int) ( ( Constants.SCREEN_WIDTH / UIUtils.getScreenOptimalColumnsPixels( mFilterCellWidth ) ) );
    mThumbBitmap = generateThumbnail(mBitmap, mThumbBitmapSize, mThumbBitmapSize);
    mInstalledPackages = Collections.synchronizedList(new ArrayList<String>());
    mRoundedBordersPixelSize = config.getDimensionPixelSize(R.dimen.feather_effects_panel_thumb_rounded_border);
    mRoundedBordersPaddingPixelSize = config.getDimensionPixelSize(R.dimen.feather_effects_panel_thumb_padding);
    mShadowOffsetPixelSize = config.getDimensionPixelSize(R.dimen.feather_effects_panel_thumb_shadow_offset);
    mShadowRadiusPixelSize = config.getDimensionPixelSize(R.dimen.feather_effects_panel_thumb_shadow_radius);
    mRoundedBordersStrokePixelSize = config.getDimensionPixelSize(R.dimen.feather_effects_panel_thumb_stroke_size);
    mItemsGapPixelsSize = config.getDimensionPixelSize(R.dimen.feather_effects_panel_items_gap);
    mExternalThumbPadding = config.getDimensionPixelSize(R.dimen.feather_effects_external_thumb_padding);
    mFeaturedDefaultTitle = config.getString(R.string.feather_featured);
    mFeaturedCount = config.getInteger(R.integer.feather_featured_count);
    mHList.setGravity(Gravity.BOTTOM);
    mHList.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
    mHList.setEdgeGravityY(Gravity.BOTTOM);
    mHList.setOnItemSelectedListener(this);
    mHList.setOnItemClickedListener(this);
    mImageManager.setOnLoadCompleteListener(this);
    getContentView().setVisibility(View.VISIBLE);
    onPostActivate();
}
Also used : ConfigService(com.aviary.android.feather.library.services.ConfigService) ArrayList(java.util.ArrayList)

Example 3 with ConfigService

use of com.aviary.android.feather.library.services.ConfigService in project mobile-android by photo.

the class ColorMatrixEffectPanel method onCreate.

/*
	 * (non-Javadoc)
	 * 
	 * @see com.aviary.android.feather.effects.AbstractEffectPanel#onCreate(android.graphics.Bitmap)
	 */
@Override
public void onCreate(Bitmap bitmap) {
    super.onCreate(bitmap);
    mWheel = (Wheel) getOptionView().findViewById(R.id.wheel);
    mWheelRadio = (WheelRadio) getOptionView().findViewById(R.id.wheel_radio);
    ConfigService config = getContext().getService(ConfigService.class);
    mLivePreview = config.getBoolean(R.integer.feather_brightness_live_preview);
    onCreateIcons();
}
Also used : ConfigService(com.aviary.android.feather.library.services.ConfigService)

Example 4 with ConfigService

use of com.aviary.android.feather.library.services.ConfigService in project mobile-android by photo.

the class DelayedSpotDrawPanel method onCreate.

/*
	 * (non-Javadoc)
	 * 
	 * @see com.aviary.android.feather.effects.AbstractEffectPanel#onCreate(android.graphics.Bitmap)
	 */
@Override
public void onCreate(Bitmap bitmap) {
    super.onCreate(bitmap);
    ConfigService config = getContext().getService(ConfigService.class);
    mBrushSizes = config.getSizeArray(R.array.feather_spot_brush_sizes);
    mBrushSize = mBrushSizes[0];
    defaultOption = Math.min(mBrushSizes.length - 1, Math.max(0, config.getInteger(R.integer.feather_spot_brush_selected_size_index)));
    mLensButton = (ImageButton) getContentView().findViewById(R.id.lens_button);
    mImageView = (ImageViewSpotDraw) getContentView().findViewById(R.id.image);
    ((ImageViewSpotDraw) mImageView).setBrushSize((float) mBrushSize);
    ((ImageViewSpotDraw) mImageView).setDrawLimit(mLimitDrawArea ? 1000.0 : 0.0);
    mPreview = BitmapUtils.copy(mBitmap, Config.ARGB_8888);
    mImageView.setImageBitmap(mPreview, true, getContext().getCurrentImageViewMatrix(), UIConfiguration.IMAGE_VIEW_MAX_ZOOM);
    mGallery = (Gallery) getOptionView().findViewById(R.id.gallery);
    mGallery.setCallbackDuringFling(false);
    mGallery.setSpacing(0);
    mGallery.setOnItemsScrollListener(new OnItemsScrollListener() {

        @Override
        public void onScrollFinished(AdapterView<?> parent, View view, int position, long id) {
            mBrushSize = mBrushSizes[position];
            ((ImageViewSpotDraw) mImageView).setBrushSize((float) mBrushSize);
            setSelectedTool(TouchMode.DRAW);
            updateSelection(view, position);
            hideSizePreview();
        }

        @Override
        public void onScrollStarted(AdapterView<?> parent, View view, int position, long id) {
            showSizePreview(mBrushSizes[position]);
            setSelectedTool(TouchMode.DRAW);
        }

        @Override
        public void onScroll(AdapterView<?> parent, View view, int position, long id) {
            updateSizePreview(mBrushSizes[position]);
        }
    });
    mBackgroundDrawThread = new MyHandlerThread("filter-thread", Thread.MIN_PRIORITY);
    initAdapter();
}
Also used : ConfigService(com.aviary.android.feather.library.services.ConfigService) OnItemsScrollListener(com.aviary.android.feather.widget.Gallery.OnItemsScrollListener) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(com.aviary.android.feather.widget.AdapterView) ImageViewSpotDraw(com.aviary.android.feather.widget.ImageViewSpotDraw)

Example 5 with ConfigService

use of com.aviary.android.feather.library.services.ConfigService in project mobile-android by photo.

the class SpotDrawPanel method onCreate.

/*
	 * (non-Javadoc)
	 * 
	 * @see com.aviary.android.feather.effects.AbstractEffectPanel#onCreate(android.graphics.Bitmap)
	 */
@Override
public void onCreate(Bitmap bitmap) {
    super.onCreate(bitmap);
    mFilter = createFilter();
    ConfigService config = getContext().getService(ConfigService.class);
    mBrushSizes = config.getSizeArray(R.array.feather_spot_brush_sizes);
    mBrushSize = mBrushSizes[0];
    mLensButton = (ImageButton) getContentView().findViewById(R.id.lens_button);
    mImageView = (ImageViewSpotDraw) getContentView().findViewById(R.id.image);
    ((ImageViewSpotDraw) mImageView).setBrushSize((float) mBrushSize);
    mPreview = BitmapUtils.copy(mBitmap, Config.ARGB_8888);
    mPreviewWidth = mPreview.getWidth();
    mPreviewHeight = mPreview.getHeight();
    mImageView.setImageBitmap(mPreview, true, getContext().getCurrentImageViewMatrix(), UIConfiguration.IMAGE_VIEW_MAX_ZOOM);
    int defaultOption = config.getInteger(R.integer.feather_spot_brush_selected_size_index);
    defaultOption = Math.min(Math.max(defaultOption, 0), mBrushSizes.length - 1);
    mGallery = (Gallery) getOptionView().findViewById(R.id.gallery);
    mGallery.setCallbackDuringFling(false);
    mGallery.setSpacing(0);
    mGallery.setOnItemsScrollListener(new OnItemsScrollListener() {

        @Override
        public void onScrollFinished(AdapterView<?> parent, View view, int position, long id) {
            mLogger.info("onScrollFinished: " + position);
            mBrushSize = mBrushSizes[position];
            ((ImageViewSpotDraw) mImageView).setBrushSize((float) mBrushSize);
            setSelectedTool(TouchMode.DRAW);
            updateSelection(view, position);
            hideSizePreview();
        }

        @Override
        public void onScrollStarted(AdapterView<?> parent, View view, int position, long id) {
            showSizePreview(mBrushSizes[position]);
            setSelectedTool(TouchMode.DRAW);
        }

        @Override
        public void onScroll(AdapterView<?> parent, View view, int position, long id) {
            updateSizePreview(mBrushSizes[position]);
        }
    });
    mBackgroundDrawThread = new MyHandlerThread("filter-thread", Thread.MIN_PRIORITY);
    initAdapter();
}
Also used : ConfigService(com.aviary.android.feather.library.services.ConfigService) OnItemsScrollListener(com.aviary.android.feather.widget.Gallery.OnItemsScrollListener) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(com.aviary.android.feather.widget.AdapterView) ImageViewSpotDraw(com.aviary.android.feather.widget.ImageViewSpotDraw)

Aggregations

ConfigService (com.aviary.android.feather.library.services.ConfigService)6 View (android.view.View)2 ImageView (android.widget.ImageView)2 AdapterView (com.aviary.android.feather.widget.AdapterView)2 OnItemsScrollListener (com.aviary.android.feather.widget.Gallery.OnItemsScrollListener)2 ImageViewSpotDraw (com.aviary.android.feather.widget.ImageViewSpotDraw)2 Paint (android.graphics.Paint)1 CropImageView (com.aviary.android.feather.widget.CropImageView)1 ArrayList (java.util.ArrayList)1