+
+ public void enableDisableViewGroup(ViewGroup viewGroup, boolean enabled) {
+ int childCount = viewGroup.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ View view = viewGroup.getChildAt(i);
+ view.setEnabled(enabled);
+ view.setClickable(!enabled);
+ if (view instanceof ViewGroup) {
+ enableDisableViewGroup((ViewGroup) view, enabled);
+ }
+ }
+ }