private void initFromAttributes(Context context, AttributeSet attrs,
                               int defStyleAttr, int defStyleRes) {
        // Read and apply provided attributes
        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.JCropImageView, defStyleAttr, defStyleRes);
        mCropType = a.getInt(R.styleable.JCropImageView_cropType, mCropType);
        mCropAlign = a.getInt(R.styleable.JCropImageView_cropAlign, mCropAlign);
        a.recycle();

        setCropType(mCropType);
    }
private void initFromAttributes ( Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { TypedArray a = context . obtainStyledAttributes ( attrs , R . styleable . JCropImageView , defStyleAttr , defStyleRes ) ; mCropType = a . getInt ( R . styleable . JCropImageView_cropType , mCropType ) ; mCropAlign = a . getInt ( R . styleable . JCropImageView_cropAlign , mCropAlign ) ; a . recycle ( ) ; setCropType ( mCropType ) ; }
Initialize the attributes for JCropImageView

@param context The Context the view is running in, through which it can
access the current theme, resources, etc.
@param attrs The attributes of the XML tag that is inflating the view.
@param defStyleAttr An attribute in the current theme that contains a
reference to a style resource that supplies default values for
the view. Can be 0 to not look for defaults.
@param defStyleRes A resource identifier of a style resource that
supplies default values for the view, used only if
defStyleAttr is 0 or can not be found in the theme. Can be 0
to not look for defaults.
@see @link android.view.View(Context, AttributeSet, int)