Revision 3a4f3ae2
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/examples/glow/GlowActivity.java | ||
---|---|---|
32 | 32 |
|
33 | 33 |
public class GlowActivity extends Activity implements SeekBar.OnSeekBarChangeListener |
34 | 34 |
{ |
35 |
private TextView textGlow;
|
|
35 |
private TextView textRadius, textAlpha;
|
|
36 | 36 |
|
37 | 37 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
38 | 38 |
|
... | ... | |
41 | 41 |
{ |
42 | 42 |
super.onCreate(savedState); |
43 | 43 |
setContentView(R.layout.glowlayout); |
44 |
textGlow = (TextView)findViewById(R.id.glowText); |
|
45 |
SeekBar bar = (SeekBar)findViewById(R.id.glowSeek); |
|
44 |
|
|
45 |
textRadius = (TextView)findViewById(R.id.glowTextRadius); |
|
46 |
SeekBar bar = (SeekBar)findViewById(R.id.glowSeekRadius); |
|
47 |
bar.setOnSeekBarChangeListener(this); |
|
48 |
bar.setProgress(50); |
|
49 |
|
|
50 |
textAlpha = (TextView)findViewById(R.id.glowTextAlpha); |
|
51 |
bar = (SeekBar)findViewById(R.id.glowSeekAlpha); |
|
46 | 52 |
bar.setOnSeekBarChangeListener(this); |
47 | 53 |
bar.setProgress(50); |
48 | 54 |
} |
... | ... | |
85 | 91 |
|
86 | 92 |
switch (bar.getId()) |
87 | 93 |
{ |
88 |
case R.id.glowSeek: int level = view.getRenderer().setGlow(progress); |
|
89 |
textGlow.setText(getString(R.string.glow_placeholder,level)); |
|
90 |
break; |
|
94 |
case R.id.glowSeekRadius: int radius = view.getRenderer().setGlowRadius(progress); |
|
95 |
textRadius.setText(getString(R.string.glow_radius_placeholder,radius)); |
|
96 |
break; |
|
97 |
case R.id.glowSeekAlpha : float alpha = view.getRenderer().setGlowAlpha(progress); |
|
98 |
textAlpha.setText(getString(R.string.glow_alpha_placeholder, alpha)); |
|
99 |
break; |
|
91 | 100 |
} |
92 | 101 |
} |
93 | 102 |
|
Also available in: Unified diff
Improve 'Glow' app.