Revision 722c6ed3
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/olimpic/OlimpicActivity.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.examples.olimpic; |
21 | 21 |
|
22 |
import org.distorted.examples.R; |
|
22 | 23 |
import org.distorted.library.Distorted; |
23 | 24 |
|
24 | 25 |
import android.app.Activity; |
26 |
import android.opengl.GLSurfaceView; |
|
25 | 27 |
import android.os.Bundle; |
28 |
import android.widget.TextView; |
|
26 | 29 |
|
27 | 30 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
28 | 31 |
|
29 | 32 |
public class OlimpicActivity extends Activity |
30 | 33 |
{ |
31 |
private OlimpicSurfaceView mView;
|
|
34 |
private TextView mText;
|
|
32 | 35 |
|
33 | 36 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
34 |
|
|
37 |
|
|
38 |
void setText(String text) |
|
39 |
{ |
|
40 |
mText.setText(text); |
|
41 |
} |
|
42 |
|
|
43 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
44 |
|
|
35 | 45 |
@Override |
36 | 46 |
protected void onCreate(Bundle icicle) |
37 | 47 |
{ |
38 | 48 |
super.onCreate(icicle); |
39 |
mView = new OlimpicSurfaceView(this);
|
|
40 |
setContentView(mView);
|
|
49 |
setContentView(R.layout.olimpiclayout);
|
|
50 |
mText = (TextView)findViewById(R.id.olimpicText);
|
|
41 | 51 |
} |
42 | 52 |
|
43 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
45 | 55 |
@Override |
46 | 56 |
protected void onPause() |
47 | 57 |
{ |
48 |
mView.onPause(); |
|
58 |
GLSurfaceView view = (GLSurfaceView) this.findViewById(R.id.olimpicSurfaceView); |
|
59 |
view.onPause(); |
|
49 | 60 |
super.onPause(); |
50 | 61 |
} |
51 | 62 |
|
... | ... | |
55 | 66 |
protected void onResume() |
56 | 67 |
{ |
57 | 68 |
super.onResume(); |
58 |
mView.onResume(); |
|
69 |
GLSurfaceView view = (GLSurfaceView) this.findViewById(R.id.olimpicSurfaceView); |
|
70 |
view.onResume(); |
|
59 | 71 |
} |
60 | 72 |
|
61 | 73 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Improve Olimpic.