Revision 77e66c58
Added by Leszek Koltunski over 2 years ago
| src/main/java/org/distorted/examples/blur/BlurActivity.java | ||
|---|---|---|
| 96 | 96 |
|
| 97 | 97 |
public void onProgressChanged(SeekBar bar, int progress, boolean fromUser) |
| 98 | 98 |
{
|
| 99 |
BlurSurfaceView view = findViewById(R.id.blurSurfaceView); |
|
| 99 |
BlurSurfaceView v = findViewById(R.id.blurSurfaceView); |
|
| 100 |
BlurRenderer r = v.getRenderer(); |
|
| 101 |
int id = bar.getId(); |
|
| 100 | 102 |
|
| 101 |
switch( bar.getId() )
|
|
| 103 |
if( id == R.id.blurSeek )
|
|
| 102 | 104 |
{
|
| 103 |
case R.id.blurSeek: int l1 = view.getRenderer().setBlur(progress); |
|
| 104 |
textBlur.setText(getString(R.string.blur_placeholder,l1)); |
|
| 105 |
break; |
|
| 106 |
case R.id.haloSeek: int l2 = view.getRenderer().setHalo(progress); |
|
| 107 |
textHalo.setText(getString(R.string.halo_placeholder,l2)); |
|
| 108 |
break; |
|
| 109 |
case R.id.moveSeek: int l3 = view.getRenderer().setMove(progress); |
|
| 110 |
textMove.setText(getString(R.string.move_placeholder,l3)); |
|
| 111 |
break; |
|
| 105 |
int l = r.setBlur(progress); |
|
| 106 |
textBlur.setText(getString(R.string.blur_placeholder,l)); |
|
| 107 |
} |
|
| 108 |
if( id == R.id.haloSeek ) |
|
| 109 |
{
|
|
| 110 |
int l = r.setHalo(progress); |
|
| 111 |
textHalo.setText(getString(R.string.halo_placeholder,l)); |
|
| 112 |
} |
|
| 113 |
if( id == R.id.moveSeek ) |
|
| 114 |
{
|
|
| 115 |
int l = r.setMove(progress); |
|
| 116 |
textMove.setText(getString(R.string.move_placeholder,l)); |
|
| 112 | 117 |
} |
| 113 | 118 |
} |
| 114 | 119 |
|
Also available in: Unified diff
in API 34 R.id. things are no loger constants and cannot be used in switches.