package com.hackplan.androidarcmenu.demo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.hackplan.androidarcmenu.ArcButton;
import com.hackplan.androidarcmenu.ArcMenu;

public class MainActivity extends AppCompatActivity implements ArcMenu.OnClickBtnListener, View.OnLongClickListener{
    private ArcMenu arcMenu;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final Button btn1 = (Button) findViewById(R.id.btn1);
        final Button btn2 = (Button) findViewById(R.id.btn2);
        final Button btn3 = (Button) findViewById(R.id.btn3);
        arcMenu = new ArcMenu.Builder(MainActivity.this)
                .addBtn(R.drawable.a, 0)
                .addBtn(R.drawable.r, 1)
                .addBtns(new ArcButton.Builder(R.drawable.w, 2))
                .setListener(MainActivity.this)
                .showOnLongClick(btn1)
                .showOnTouch(btn2)
                .hideOnTouchUp(false)
                .build();

        btn3.setOnLongClickListener(this);
    }

    @Override
    public void onClickArcMenu(View menuView, int id) {
        Toast.makeText(this, String.format("Click #%s", id), Toast.LENGTH_SHORT).show();
    }

    @Override
    public boolean onLongClick(View v) {
        arcMenu.showOn(v);
        return true;
    }
}

@@ -36,16 +36,42 @@
 .demo;%0A%0A
+import android.os.Bundle;%0A
 import a
@@ -115,34 +115,8 @@
 ty;%0A
-import android.os.Bundle;%0A
 impo
@@ -432,16 +432,26 @@
  arcMenu
+, arcMenu2
 ;%0A%0A    @
@@ -794,16 +794,92 @@
 .btn3);%0A
+        Button menuBtn = new Button(this);%0A        menuBtn.setText(%22TEST%22);%0A
         
@@ -1013,73 +1013,8 @@
  1)%0A
-                .addBtns(new ArcButton.Builder(R.drawable.w, 2))%0A
     
@@ -1096,16 +1096,288 @@
 k(btn1)%0A
+                .hideOnTouchUp(false)%0A                .build();%0A%0A        arcMenu2 = new ArcMenu.Builder(MainActivity.this)%0A                .addBtn(R.drawable.w, 6)%0A                .addBtns(new ArcButton.Builder(menuBtn, 2))%0A                .setListener(MainActivity.this)%0A
         
@@ -1426,36 +1426,35 @@
  .hideOnTouchUp(
-fals
+tru
 e)%0A             

update demo