1 |
a2cb31e9
|
Leszek Koltunski
|
|
2 |
|
|
package org.distorted.examples.save;
|
3 |
|
|
|
4 |
|
|
import org.distorted.library.Distorted;
|
5 |
|
|
import org.distorted.examples.R;
|
6 |
|
|
|
7 |
|
|
import android.app.Activity;
|
8 |
|
|
import android.opengl.GLSurfaceView;
|
9 |
|
|
import android.os.Bundle;
|
10 |
|
|
import android.view.View;
|
11 |
|
|
import android.widget.Button;
|
12 |
|
|
import android.widget.SeekBar;
|
13 |
|
|
|
14 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
15 |
|
|
|
16 |
|
|
public class SaveActivity extends Activity implements SeekBar.OnSeekBarChangeListener
|
17 |
|
|
{
|
18 |
|
|
private Button mSave;
|
19 |
|
|
private SeekBar barSize;
|
20 |
|
|
|
21 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
22 |
|
|
|
23 |
|
|
@Override
|
24 |
|
|
protected void onCreate(Bundle icicle)
|
25 |
|
|
{
|
26 |
|
|
super.onCreate(icicle);
|
27 |
|
|
|
28 |
|
|
setContentView(R.layout.savelayout);
|
29 |
|
|
|
30 |
|
|
mSave = (Button)findViewById(R.id.saveButton);
|
31 |
|
|
|
32 |
|
|
barSize = (SeekBar)findViewById(R.id.saveSeekBar);
|
33 |
|
|
barSize.setOnSeekBarChangeListener(this);
|
34 |
|
|
barSize.setProgress(50);
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
38 |
|
|
|
39 |
|
|
@Override
|
40 |
|
|
protected void onPause()
|
41 |
|
|
{
|
42 |
|
|
GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.saveSurfaceView);
|
43 |
|
|
mView.onPause();
|
44 |
|
|
|
45 |
|
|
super.onPause();
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
49 |
|
|
|
50 |
|
|
@Override
|
51 |
|
|
protected void onResume()
|
52 |
|
|
{
|
53 |
|
|
super.onResume();
|
54 |
|
|
|
55 |
|
|
GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.saveSurfaceView);
|
56 |
|
|
mView.onResume();
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
60 |
|
|
|
61 |
|
|
@Override
|
62 |
|
|
protected void onDestroy()
|
63 |
|
|
{
|
64 |
|
|
Distorted.onDestroy();
|
65 |
|
|
super.onDestroy();
|
66 |
|
|
}
|
67 |
|
|
|
68 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
69 |
|
|
|
70 |
|
|
public void Save(View v)
|
71 |
|
|
{
|
72 |
7cfeeb63
|
Leszek Koltunski
|
SaveRenderer.Save();
|
73 |
a2cb31e9
|
Leszek Koltunski
|
}
|
74 |
|
|
|
75 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
76 |
|
|
|
77 |
|
|
public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
|
78 |
|
|
{
|
79 |
|
|
float s = (progress>50 ? ((progress-50)/16.0f + 1.0f):(0.015f*progress + 0.25f));
|
80 |
|
|
SaveRenderer.setSize(s);
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
84 |
|
|
|
85 |
|
|
public void onStartTrackingTouch(SeekBar bar) { }
|
86 |
|
|
|
87 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
|
|
|
89 |
|
|
public void onStopTrackingTouch(SeekBar bar) { }
|
90 |
|
|
|
91 |
|
|
}
|