Android Open Source - opengl Menu






From Project

Back to project page opengl.

License

The source code is released under:

Apache License

If you think the Android project opengl listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.androidbook.opengl;
/*from  w  ww  .j  a v a  2s  .c  o  m*/

import java.util.SortedMap;
import java.util.TreeMap;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public abstract class Menu extends ListActivity {
  private SortedMap<String, Object> actions = new TreeMap<String, Object>();

  
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    String key = (String) l.getItemAtPosition(position);
    startActivity((Intent) actions.get(key));
  }
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    prepareMenu();

    String[] keys = actions.keySet().toArray(
        new String[actions.keySet().size()]);

    setListAdapter(new ArrayAdapter<String>(this,
        android.R.layout.simple_list_item_1, keys));
  }
  
  public void addMenuItem(String label, Class<?> cls){
    actions.put(label, new Intent(this, cls  ));
  }
  
  abstract void prepareMenu();
}




Java Source Code List

book.BouncyCube.BouncyCubeActivity.java
book.BouncyCube.BouncyCubeActivity.java
book.BouncyCube.BouncyCubeRenderer.java
book.BouncyCube.BouncyCubeRenderer.java
book.BouncyCube.Cube.java
book.BouncyCube.Cube.java
book.SolarSystem.Cube.java
book.SolarSystem.Cube.java
book.SolarSystem.Planet.java
book.SolarSystem.Planet.java
book.SolarSystem.SolarSystemActivity.java
book.SolarSystem.SolarSystemActivity.java
book.SolarSystem.SolarSystemRenderer.java
book.SolarSystem.SolarSystemRenderer.java
com.androidbook.opengl.AndroidOpenGL.java
com.androidbook.opengl.AndroidOpenGL.java
com.androidbook.opengl.BasicGLCube.java
com.androidbook.opengl.BasicGLCube.java
com.androidbook.opengl.BasicGL.java
com.androidbook.opengl.BasicGL.java
com.androidbook.opengl.CubeSmallGLUT.java
com.androidbook.opengl.CubeSmallGLUT.java
com.androidbook.opengl.Menu.java
com.androidbook.opengl.Menu.java
com.androidbook.opengl.OpenGLPlay.java
com.androidbook.opengl.OpenGLPlay.java
com.androidbook.opengl.SimpleFPSDisplay.java
com.androidbook.opengl.SimpleFPSDisplay.java
com.androidbook.opengl.SimpleLitGLCube.java
com.androidbook.opengl.SimpleLitGLCube.java
com.androidbook.opengl.SmallGLUT.java
com.androidbook.opengl.SmallGLUT.java
com.androidbook.opengl.TexCubeSmallGLUT.java
com.androidbook.opengl.TexCubeSmallGLUT.java
com.androidbook.opengl.TextureGL.java
com.androidbook.opengl.TextureGL.java
com.androidbook.opengl.TriangleSmallGLUT.java
com.androidbook.opengl.TriangleSmallGLUT.java
com.droidnova.android.games.vortex.VortexRenderer.java
com.droidnova.android.games.vortex.VortexRenderer.java
com.droidnova.android.games.vortex.VortexView.java
com.droidnova.android.games.vortex.VortexView.java
com.droidnova.android.games.vortex.Vortex.java
com.droidnova.android.games.vortex.Vortex.java
com.example.android.opengl.MyGLRenderer.java
com.example.android.opengl.MyGLRenderer.java
com.example.android.opengl.MyGLSurfaceView.java
com.example.android.opengl.MyGLSurfaceView.java
com.example.android.opengl.OpenGLES20Activity.java
com.example.android.opengl.OpenGLES20Activity.java
com.example.android.opengl.Square.java
com.example.android.opengl.Square.java
com.example.android.opengl.Triangle.java
com.example.android.opengl.Triangle.java
edu.cs4730.OpenGlDemo1.OpenGlDemo1Activity.java
edu.cs4730.OpenGlDemo1.OpenGlDemo1Activity.java
edu.cs4730.OpenGlDemo1.SquareRenderer.java
edu.cs4730.OpenGlDemo1.SquareRenderer.java
edu.cs4730.OpenGlDemo1.Square.java
edu.cs4730.OpenGlDemo1.Square.java
edu.cs4730.OpenGlDemo.OpenGLRenderer.java
edu.cs4730.OpenGlDemo.OpenGLRenderer.java
edu.cs4730.OpenGlDemo.OpenGlDemo.java
edu.cs4730.OpenGlDemo.OpenGlDemo.java
edu.cs4730.OpenGlDemo.Square.java
edu.cs4730.OpenGlDemo.Square.java
edu.cs4730.opengl2ex1.LessonOneRenderer.java
edu.cs4730.opengl2ex1.LessonOneRenderer.java
edu.cs4730.opengl2ex1.MainActivity.java
edu.cs4730.opengl2ex1.MainActivity.java
edu.cs4730.opengl2ex2.LessonOneRenderer.java
edu.cs4730.opengl2ex2.LessonOneRenderer.java
edu.cs4730.opengl2ex2.MainActivity.java
edu.cs4730.opengl2ex2.MainActivity.java
edu.cs4730.opengl2ex2.myGlSurfaceView.java
edu.cs4730.opengl2ex2.myGlSurfaceView.java