Project

General

Profile

« Previous | Next » 

Revision dea555b9

Added by Leszek Koltunski almost 5 years ago

Add the 'convexity' param to Dynamics and the Dynamic app.

View differences:

src/main/java/org/distorted/examples/dynamic/DynamicActivity.java
41 41

  
42 42
public class DynamicActivity extends Activity implements OnSeekBarChangeListener, AdapterView.OnItemSelectedListener
43 43
    {
44
    private TextView textD, textC, textN;
44
    private TextView textD, textC, textN, textX;
45 45
    private int p0,p1,p2;
46 46
    private int mDim, mMode;
47 47

  
......
55 55

  
56 56
      textD = findViewById(R.id.dynamicTextDuration);
57 57
      textC = findViewById(R.id.dynamicTextCount);
58
      textX = findViewById(R.id.dynamicTextConvexity);
58 59
      textN = findViewById(R.id.dynamicTextNoise);
59 60

  
60 61
      p0=p1=p2=0;
......
65 66
      barD.setOnSeekBarChangeListener(this);
66 67
      SeekBar barC = findViewById(R.id.dynamicSeekCount);
67 68
      barC.setOnSeekBarChangeListener(this);
69
      SeekBar barX = findViewById(R.id.dynamicSeekConvexity);
70
      barX.setOnSeekBarChangeListener(this);
68 71
      SeekBar bar0 = findViewById(R.id.dynamicSeekNoise0);
69 72
      bar0.setOnSeekBarChangeListener(this);
70 73
      SeekBar bar1 = findViewById(R.id.dynamicSeekNoise1);
......
94 97
        {
95 98
        barD.setProgress(50);
96 99
        barC.setProgress(20);
100
        barX.setProgress(50);
97 101
        bar0.setProgress(0);
98 102
        bar1.setProgress(0);
99 103
        bar2.setProgress(0);
......
285 289
        view.setCount(count);
286 290
        textC.setText(getString(R.string.count_placeholder, count ));
287 291
        }
292
      else if( id == R.id.dynamicSeekConvexity )
293
        {
294
        float convexity = progress/25.0f - 1.0f;
295
        view.setConvexity(convexity);
296
        textX.setText(getString(R.string.convexity_placeholder, convexity ));
297
        }
288 298
      else
289 299
        {
290 300
        switch(id)

Also available in: Unified diff