Project

General

Profile

« Previous | Next » 

Revision 201376f3

Added by Leszek Koltunski about 5 years ago

Rubk App: add 4 buttons in the top.

View differences:

src/main/java/org/distorted/examples/rubik/RubikActivity.java
20 20
package org.distorted.examples.rubik;
21 21

  
22 22
import android.app.Activity;
23
import android.opengl.GLSurfaceView;
23 24
import android.os.Bundle;
25
import android.view.View;
24 26

  
27
import org.distorted.examples.R;
25 28
import org.distorted.library.main.Distorted;
26 29

  
27 30
///////////////////////////////////////////////////////////////////////////////////////////////////
28 31

  
29 32
public class RubikActivity extends Activity
30 33
{
31
    private RubikSurfaceView mView;
32

  
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34

  
35 34
    @Override
36 35
    protected void onCreate(Bundle icicle)
37 36
      {
38 37
      super.onCreate(icicle);
39
      mView = new RubikSurfaceView(this);
40
      setContentView(mView);
38
      setContentView(R.layout.rubiklayout);
41 39
      }
42 40

  
43 41
///////////////////////////////////////////////////////////////////////////////////////////////////
......
45 43
    @Override
46 44
    protected void onPause() 
47 45
      {
48
      mView.onPause();
46
      GLSurfaceView view = findViewById(R.id.rubikSurfaceView);
47
      view.onPause();
49 48
      Distorted.onPause();
50 49
      super.onPause();
51 50
      }
......
56 55
    protected void onResume() 
57 56
      {
58 57
      super.onResume();
59
      mView.onResume();
58
      GLSurfaceView view = findViewById(R.id.rubikSurfaceView);
59
      view.onResume();
60 60
      }
61 61
    
62 62
///////////////////////////////////////////////////////////////////////////////////////////////////
......
67 67
      Distorted.onDestroy();  
68 68
      super.onDestroy();
69 69
      }
70

  
71
///////////////////////////////////////////////////////////////////////////////////////////////////
72

  
73
    public void Scramble(View v)
74
      {
75
      android.util.Log.e("rubik", "scrambling...");
76
      }
77

  
78
///////////////////////////////////////////////////////////////////////////////////////////////////
79

  
80
    public void setSize(View v)
81
      {
82
      android.util.Log.e("rubik", "setting size...");
83
      }
70 84
}

Also available in: Unified diff