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

    try {
      int color = attr.getColor(R.styleable.MaterialMenuView_mm_color, DEFAULT_COLOR);
      int scale = attr.getInteger(R.styleable.MaterialMenuView_mm_scale, DEFAULT_SCALE);
      int transformDuration =
          attr.getInteger(
              R.styleable.MaterialMenuView_mm_transformDuration, DEFAULT_TRANSFORM_DURATION);
      int pressedDuration =
          attr.getInteger(
              R.styleable.MaterialMenuView_mm_pressedDuration, DEFAULT_PRESSED_DURATION);
      MaterialMenuDrawable.Stroke stroke =
          MaterialMenuDrawable.Stroke.valueOf(
              attr.getInteger(R.styleable.MaterialMenuView_mm_strokeWidth, 0));
      boolean rtlEnabled = attr.getBoolean(R.styleable.MaterialMenuView_mm_rtlEnabled, false);

      drawable =
          new MaterialMenuDrawable(
              context, color, stroke, scale, transformDuration, pressedDuration);
      drawable.setRTLEnabled(rtlEnabled);
    } finally {
      attr.recycle();
    }

    drawable.setCallback(this);
  }
 @Override
 public void setRTLEnabled(boolean rtlEnabled) {
   drawable.setRTLEnabled(rtlEnabled);
 }