Exemplo n.º 1
0
  @Override
  protected void onResume() {
    super.onResume();
    glw.onResume();

    for (File child : new File(dirname).listFiles()) {
      String filename = child.getAbsolutePath().toString();
      if (filename.endsWith("." + GlobalConstants.FILE_IMAGE_EXTENSION)) {
        renderer.addImage(filename);
        Util.debug("NEW IMAGE FILE FOUND");
      }
    }
  }
Exemplo n.º 2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent intent = getIntent();
    dirname = intent.getStringExtra(GalleryListActivity.KEY_PANORAMA_DIRNAME);

    // _____________________________________________________________
    // Creating a translucent OpenGL ES SurfaceView
    glw = new PanoGLSurfaceView(this, false);
    glw.setZOrderMediaOverlay(true);

    // We want an 8888 pixel format because that's required for a translucent window.
    // And we want a depth buffer.
    // IMPORTANT - This method can only be called before setRenderer() is called.
    glw.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
    // glw.setEGLConfigChooser(false);

    renderer = new PanoGLVortexRenderer(glw);

    // Tell the cube renderer that we want to render a translucent version of the cube:
    glw.setRenderer(renderer);
    // glw.setRenderer(new CubeRenderer(this, true));

    // Setting how frequent is the onDrawFrame() method called.
    // RENDERMODE_CONTINUOUSLY - call continuously with a specific time delay between calls.
    // RENDERMODE_WHEN_DIRTY - the renderer only renders when the surface is created, or when
    // requestRender() is called.
    // IMPORTANT - This method can only be called after setRenderer() is called.
    glw.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);

    // Use a surface format with an Alpha channel:
    // glw.getHolder().setFormat(PixelFormat.RGBA_8888);
    // glw.getHolder().setFormat(PixelFormat.TRANSLUCENT);

    // setting layout parameters
    glw.setLayoutParams(new LayoutParams(MATCH_PARENT, MATCH_PARENT));

    // _____________________________________________________________
    // Inflating camera_buttons.xml
    btnView = getLayoutInflater().inflate(R.layout.camera_buttons, null);

    // _____________________________________________________________
    // Set some window parameters
    // make the application fullScreen
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    // Window flag: as long as this window is visible to the user, keep the device's screen turned
    // on and bright.
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    // _____________________________________________________________
    // Building the final FrameLayout
    fl = new FrameLayout(this);
    fl.addView(glw);
    fl.addView(btnView);
    setContentView(fl);

    // ===========================================================================================
    // SETTING LISTENERS

    btnAlbum = (Button) btnView.findViewById(R.id.btn_album);
    btnSettings = (Button) btnView.findViewById(R.id.btn_settings);
    btnShoot = (Button) btnView.findViewById(R.id.btn_shoot);

    btnAlbum.setOnClickListener(this);
    btnSettings.setOnClickListener(this);
    btnShoot.setOnClickListener(this);

    activityCreated = true;
  }
Exemplo n.º 3
0
 @Override
 protected void onPause() {
   super.onPause();
   glw.onPause();
 }