Search in sources :

Example 1 with ArcMenu

use of com.capricorn.ArcMenu in project ArcMenu by daCapricorn.

the class MainActivity method onCreate.

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ArcMenu arcMenu = (ArcMenu) findViewById(R.id.arc_menu);
    ArcMenu arcMenu2 = (ArcMenu) findViewById(R.id.arc_menu_2);
    initArcMenu(arcMenu, ITEM_DRAWABLES);
    initArcMenu(arcMenu2, ITEM_DRAWABLES);
    RayMenu rayMenu = (RayMenu) findViewById(R.id.ray_menu);
    final int itemCount = ITEM_DRAWABLES.length;
    for (int i = 0; i < itemCount; i++) {
        ImageView item = new ImageView(this);
        item.setImageResource(ITEM_DRAWABLES[i]);
        final int position = i;
        rayMenu.addItem(item, new OnClickListener() {

            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "position:" + position, Toast.LENGTH_SHORT).show();
            }
        });
    // Add a menu item
    }
}
Also used : ArcMenu(com.capricorn.ArcMenu) OnClickListener(android.view.View.OnClickListener) RayMenu(com.capricorn.RayMenu) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 ImageView (android.widget.ImageView)1 ArcMenu (com.capricorn.ArcMenu)1 RayMenu (com.capricorn.RayMenu)1