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
}
}
Aggregations