Back to project page AndroidCircularMenu.
The source code is released under:
Apache License
If you think the Android project AndroidCircularMenu listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package es.madgeeklabs.circularview; //from www . j a va 2 s.c o m import java.util.HashMap; import es.madgeeklabs.circularview.R; import es.madgeeklabs.circularview.views.CircularView; import android.os.Bundle; import android.app.Activity; import android.graphics.drawable.Drawable; import android.view.Menu; public class MainActivity extends Activity { private CircularView view; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); view = (CircularView) findViewById(R.id.circularView1); view.setAnimation(CircularView.EXPAND); view.setSizeOfElements(30, 30); int [] elementos = {0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,1,1,1,0,1,0,1,1,1}; view.setElements(elementos); HashMap<Integer, Drawable> drawables = new HashMap<Integer, Drawable>(); drawables.put(0, getResources().getDrawable(R.drawable.red_circle)); drawables.put(1, getResources().getDrawable(R.drawable.green_circle)); view.setResources(drawables); // view.paint(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } }