Add setEnabledRecursively utility function
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 12 Jun 2013 17:00:08 +0000 (20:00 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 12 Jun 2013 17:00:08 +0000 (20:00 +0300)
src/ro/ieval/unical/Utils.java [new file with mode: 0644]

diff --git a/src/ro/ieval/unical/Utils.java b/src/ro/ieval/unical/Utils.java
new file mode 100644 (file)
index 0000000..b163434
--- /dev/null
@@ -0,0 +1,15 @@
+package ro.ieval.unical;
+
+import android.view.View;
+import android.view.ViewGroup;
+
+final class Utils {
+       public void setEnabledRecursively(final View view, final boolean enabled){
+               view.setEnabled(enabled);
+               if(view instanceof ViewGroup){
+                       final ViewGroup group=(ViewGroup) view;
+                       for(int i=0;i<group.getChildCount();i++)
+                               setEnabledRecursively(group.getChildAt(i), enabled);
+               }
+       }
+}
This page took 0.010466 seconds and 4 git commands to generate.