Revision 8fd9f5fa
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/examples/vertex3d/Vertex3DActivity.java | ||
---|---|---|
79 | 79 |
private float mCenterX, mCenterY; |
80 | 80 |
private float mRegionX, mRegionY, mRegionR; |
81 | 81 |
|
82 |
private final EffectNames[] mEffectNames = { EffectNames.DISTORT, |
|
83 |
EffectNames.DEFORM , |
|
84 |
EffectNames.SINK , |
|
85 |
EffectNames.SWIRL }; |
|
82 |
private EffectNames[] mEffectNames; |
|
86 | 83 |
|
87 | 84 |
private static boolean mSupportsRegion = true; |
88 | 85 |
|
... | ... | |
95 | 92 |
|
96 | 93 |
mEffects = new ArrayList<>(); |
97 | 94 |
|
95 |
createEffectNames(); |
|
96 |
|
|
98 | 97 |
setContentView(R.layout.objectpickerlayout); |
99 | 98 |
|
100 | 99 |
mColsPicker = (NumberPicker)findViewById(R.id.objectpicker_cols); |
... | ... | |
146 | 145 |
bitmapSpinner.setAdapter(adapterBitmap); |
147 | 146 |
} |
148 | 147 |
|
148 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
149 |
|
|
150 |
private void createEffectNames() |
|
151 |
{ |
|
152 |
EffectNames[] names = EffectNames.values(); |
|
153 |
|
|
154 |
int numVertex=0; |
|
155 |
|
|
156 |
for(int i=0; i<names.length; i++) |
|
157 |
if( names[i].getType() == EffectTypes.VERTEX ) numVertex++; |
|
158 |
|
|
159 |
mEffectNames = new EffectNames[numVertex]; |
|
160 |
|
|
161 |
numVertex=0; |
|
162 |
|
|
163 |
for(int i=0; i<names.length; i++) |
|
164 |
if( names[i].getType() == EffectTypes.VERTEX ) |
|
165 |
{ |
|
166 |
mEffectNames[numVertex++] = names[i]; |
|
167 |
} |
|
168 |
} |
|
169 |
|
|
149 | 170 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
150 | 171 |
|
151 | 172 |
private void setGrid() |
Also available in: Unified diff
Vertex3D: make the Activity independent of Effects