Revision bf2e8f97
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/examples/blur/BlurActivity.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
public class BlurActivity extends Activity implements OnSeekBarChangeListener |
35 | 35 |
{ |
36 |
private TextView textBlur; |
|
36 |
private TextView textBlur, textHalo, textMove;
|
|
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
39 | 39 |
|
... | ... | |
42 | 42 |
{ |
43 | 43 |
super.onCreate(icicle); |
44 | 44 |
setContentView(R.layout.blurlayout); |
45 |
|
|
45 | 46 |
textBlur = findViewById(R.id.blurText); |
46 |
SeekBar bar = findViewById(R.id.blurSeek); |
|
47 |
bar.setOnSeekBarChangeListener(this); |
|
48 |
bar.setProgress(50); |
|
47 |
textHalo = findViewById(R.id.haloText); |
|
48 |
textMove = findViewById(R.id.moveText); |
|
49 |
|
|
50 |
SeekBar barB = findViewById(R.id.blurSeek); |
|
51 |
barB.setOnSeekBarChangeListener(this); |
|
52 |
barB.setProgress(50); |
|
53 |
|
|
54 |
SeekBar barH = findViewById(R.id.haloSeek); |
|
55 |
barH.setOnSeekBarChangeListener(this); |
|
56 |
barH.setProgress(50); |
|
57 |
|
|
58 |
SeekBar barM = findViewById(R.id.moveSeek); |
|
59 |
barM.setOnSeekBarChangeListener(this); |
|
60 |
barM.setProgress(50); |
|
49 | 61 |
} |
50 | 62 |
|
51 | 63 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
84 | 96 |
{ |
85 | 97 |
BlurSurfaceView view = findViewById(R.id.blurSurfaceView); |
86 | 98 |
|
87 |
if (bar.getId() == R.id.blurSeek)
|
|
99 |
switch( bar.getId() )
|
|
88 | 100 |
{ |
89 |
int level = view.getRenderer().setBlur(progress); |
|
90 |
textBlur.setText(getString(R.string.blur_placeholder,level)); |
|
101 |
case R.id.blurSeek: int l1 = view.getRenderer().setBlur(progress); |
|
102 |
textBlur.setText(getString(R.string.blur_placeholder,l1)); |
|
103 |
break; |
|
104 |
case R.id.haloSeek: int l2 = view.getRenderer().setHalo(progress); |
|
105 |
textHalo.setText(getString(R.string.halo_placeholder,l2)); |
|
106 |
break; |
|
107 |
case R.id.moveSeek: int l3 = view.getRenderer().setMove(progress); |
|
108 |
textMove.setText(getString(R.string.move_placeholder,l3)); |
|
109 |
break; |
|
91 | 110 |
} |
92 | 111 |
} |
93 | 112 |
|
Also available in: Unified diff
Improve the Blur App to catch the bug where a small part of the Blur (and Glow) halo gets displayed on the other edge of the surface.