package com.hackplan.androidarcmenu;

import android.content.Context;
import android.support.annotation.DrawableRes;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;

/**
 * Created by Dacer on 16/11/2016.
 */

public class ArcButton extends View{

    public ArcButton(Context context) {
        this(context, null);
    }

    public ArcButton(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public ArcButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    public static class Builder {
        @DrawableRes private int resId;
        private int id;

        public Builder(@DrawableRes int resId, int id) {
            this.resId = resId;
            this.id = id;
        }

        public View getButton(Context context) {
            ImageView arcButton = new ImageView(context);
            arcButton.setImageResource(resId);
            arcButton.setTag(id);
            return arcButton;
        }
    }
}

@@ -82,37 +82,99 @@
 oid.
-support.annotation.DrawableRe
+graphics.Color;%0Aimport android.support.annotation.DrawableRes;%0Aimport android.text.TextUtil
 s;%0Ai
@@ -723,24 +723,29 @@
 te int resId
+ = -1
 ;%0A        pr
@@ -757,16 +757,120 @@
  int id;
+%0A        private int backgroundColor = -1;%0A        private String text;%0A        private View customView;
 %0A%0A      
@@ -1001,49 +1001,640 @@
     
-public View getButton(Context context) %7B%0A
+/**%0A         * NOT COMPLETED%0A         * @param text%0A         * @param backgroundColor%0A         * @param id%0A         */%0A        private Builder(String text, int backgroundColor, int id) %7B%0A            this.text = text;%0A            this.backgroundColor = backgroundColor;%0A            this.id = id;%0A        %7D%0A%0A        public Builder(View customView, int id) %7B%0A            this.customView = customView;%0A            this.id = id;%0A        %7D%0A%0A        View getButton(Context context) %7B%0A            if (customView != null) %7B%0A                customView.setTag(id);%0A                return customView;%0A%0A            %7D else if (resId != -1) %7B%0A    
     
@@ -1691,32 +1691,36 @@
 t);%0A            
+   
+ 
 arcButton.setIma
@@ -1742,32 +1742,36 @@
 d);%0A            
+    
 arcButton.setTag
@@ -1784,24 +1784,28 @@
             
+  
+  
 return arcBu
@@ -1810,16 +1810,107 @@
 Button;%0A
+            %7D%0A            throw new RuntimeException(%22ArcButton does not init correctly%22);%0A
         

change custom text menu btn to private(unfinished)