Revision b88ec561
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/examples/effects3d/Effects3DEffect.java | ||
---|---|---|
99 | 99 |
private View mButton, mEffect, mCenter, mRegion; |
100 | 100 |
private long mId; |
101 | 101 |
|
102 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
103 |
// this will enable() all Fragment Effects twice (once for smooth variant, once for non-smooth) |
|
104 |
// but this shouldn't matter. |
|
105 |
|
|
106 |
static void enableAllEffects() |
|
107 |
{ |
|
108 |
Method method=null; |
|
109 |
|
|
110 |
for(EffectName name: EffectName.values()) |
|
111 |
{ |
|
112 |
if( name.getType() != EffectType.MATRIX ) // you don't need to enable Matrix Effects |
|
113 |
{ |
|
114 |
Class<? extends Effect> cls = name.getEffectClass(); |
|
115 |
|
|
116 |
try |
|
117 |
{ |
|
118 |
method = cls.getMethod("enable"); |
|
119 |
} |
|
120 |
catch(NoSuchMethodException ex) |
|
121 |
{ |
|
122 |
android.util.Log.e("Effects3DEffect", "exception getting method: "+ex.getMessage()); |
|
123 |
} |
|
124 |
|
|
125 |
try |
|
126 |
{ |
|
127 |
method.invoke(null); |
|
128 |
} |
|
129 |
catch(Exception ex) |
|
130 |
{ |
|
131 |
android.util.Log.e("Effects3DEffect", "exception invoking method: "+ex.getMessage()); |
|
132 |
} |
|
133 |
} |
|
134 |
} |
|
135 |
} |
|
136 |
|
|
137 | 102 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
138 | 103 |
// requires knowledge about effect nature |
139 | 104 |
|
Also available in: Unified diff
Progress with the Earth app.