private void init(Context context, AttributeSet attributeSet) {
        TypedArray attr = getTypedArray(context, attributeSet, com.balysv.materialmenu.R.styleable.MaterialMenuView);

        try {
            int color = attr.getColor(R.styleable.MaterialMenuView_mm_color, DEFAULT_COLOR);
            boolean visible = attr.getBoolean(R.styleable.MaterialMenuView_mm_visible, DEFAULT_VISIBLE);
            int scale = attr.getInteger(R.styleable.MaterialMenuView_mm_scale, DEFAULT_SCALE);
            int transformDuration = attr.getInteger(R.styleable.MaterialMenuView_mm_transformDuration, DEFAULT_TRANSFORM_DURATION);
            Stroke stroke = Stroke.valueOf(attr.getInteger(R.styleable.MaterialMenuView_mm_strokeWidth, 0));
            boolean rtlEnabled = attr.getBoolean(R.styleable.MaterialMenuView_mm_rtlEnabled, false);
            int state = attr.getInt(R.styleable.MaterialMenuView_mm_iconState, 0);

            switch (state) {
                case 0:
                    currentState = IconState.BURGER;
                    break;
                case 1:
                    currentState = IconState.ARROW;
                    break;
                case 2:
                    currentState = IconState.X;
                    break;
                case 3:
                    currentState = IconState.CHECK;
                    break;
            }

            drawable = new MaterialMenuDrawable(context, color, stroke, scale, transformDuration);

            drawable.setIconState(currentState);
            drawable.setVisible(visible);
            drawable.setRTLEnabled(rtlEnabled);
        } finally {
            attr.recycle();
        }

        drawable.setCallback(this);
    }
A basic View wrapper of {@link MaterialMenuDrawable}. Used
for custom view ActionBar or other layouts
library/src/main/java/com/balysv/materialmenu/MaterialMenuView.java