commit b82a9ac9e5439488abb7e29f1189ff3dfd9f2cb8
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Jan 3 00:49:44 2019 +0000

    Progress with the Earth app.

diff --git a/src/main/java/org/distorted/library/effect/Effect.java b/src/main/java/org/distorted/library/effect/Effect.java
index e6b7276..3fb87ce 100644
--- a/src/main/java/org/distorted/library/effect/Effect.java
+++ b/src/main/java/org/distorted/library/effect/Effect.java
@@ -19,6 +19,8 @@
 
 package org.distorted.library.effect;
 
+import java.lang.reflect.Method;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Abstract Effect of any type.
@@ -125,6 +127,46 @@ public abstract class Effect
 
     return false;
     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// this will enable() all Fragment Effects twice (once for smooth variant, once for non-smooth)
+// but this shouldn't matter.
+/**
+ * Enable all effects of a given type.
+ *
+ * @param type EffectType to enable.
+ */
+  public static void enableEffects(EffectType type)
+    {
+    Method method=null;
+
+    for(EffectName name: EffectName.values())
+      {
+      if( name.getType() == type )
+        {
+        Class<? extends Effect> cls = name.getEffectClass();
+
+        try
+          {
+          method = cls.getMethod("enable");
+          }
+        catch(NoSuchMethodException ex)
+          {
+          android.util.Log.e("Effect", "exception getting method: "+ex.getMessage());
+          }
+
+        try
+          {
+          method.invoke(null);
+          }
+        catch(Exception ex)
+          {
+          android.util.Log.e("Effect", "exception invoking method: "+ex.getMessage());
+          }
+        }
+      }
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Return the EffectType enum corresponding to this Effect.
