Revision 3b1e9c7e
Added by Leszek Koltunski almost 6 years ago
src/main/java/org/distorted/examples/effects3d/Effects3DTab.java | ||
---|---|---|
47 | 47 |
private DistortedEffects mEffects; |
48 | 48 |
private String[] mEffectStrings; |
49 | 49 |
private int mTab, mLayout, mSpinner; |
50 |
private int mChildren; |
|
50 | 51 |
|
51 | 52 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
52 | 53 |
|
... | ... | |
54 | 55 |
{ |
55 | 56 |
mList = new ArrayList<>(); |
56 | 57 |
mEffectAdd = 0; |
58 |
mChildren = 0; |
|
57 | 59 |
} |
58 | 60 |
|
59 | 61 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
154 | 156 |
Effects3DEffect eff = new Effects3DEffect(mEffectNames[mEffectAdd], act ); |
155 | 157 |
mList.add(eff); |
156 | 158 |
|
159 |
mChildren++; |
|
160 |
|
|
157 | 161 |
LinearLayout layout = act.findViewById(mLayout); |
158 |
View view = eff.createView(); |
|
162 |
View view = eff.createView(mChildren);
|
|
159 | 163 |
layout.addView(view); |
160 | 164 |
|
161 | 165 |
if( mEffectNames[mEffectAdd].supportsCenter() ) |
162 | 166 |
{ |
163 |
View center = eff.createCenter(); |
|
167 |
View center = eff.createCenter(mChildren);
|
|
164 | 168 |
layout.addView(center); |
165 | 169 |
} |
166 | 170 |
|
167 | 171 |
if( mEffectNames[mEffectAdd].supportsRegion() ) |
168 | 172 |
{ |
169 |
View region = eff.createRegion(); |
|
173 |
View region = eff.createRegion(mChildren);
|
|
170 | 174 |
layout.addView(region); |
171 | 175 |
} |
172 | 176 |
|
... | ... | |
208 | 212 |
{ |
209 | 213 |
Effects3DActivity2 act = (Effects3DActivity2)getActivity(); |
210 | 214 |
|
215 |
mChildren = 0; |
|
216 |
|
|
211 | 217 |
mList.clear(); |
212 | 218 |
LinearLayout layout = act.findViewById(mLayout); |
213 | 219 |
layout.removeAllViews(); |
... | ... | |
237 | 243 |
if( view!=null ) layout.removeView(view); |
238 | 244 |
|
239 | 245 |
mEffects.abortById(effect.getId()); |
246 |
|
|
247 |
int index = mList.indexOf(effect); |
|
248 |
int capac = mList.size(); |
|
249 |
|
|
250 |
for(int i=index+1; i<capac; i++) |
|
251 |
{ |
|
252 |
mList.get(i).setBackground(i-1); |
|
253 |
} |
|
254 |
|
|
240 | 255 |
mList.remove(effect); |
256 |
mChildren--; |
|
241 | 257 |
|
242 | 258 |
resetData(); |
243 | 259 |
|
Also available in: Unified diff
Progress with Effects3D app.