1private static void setViewAndChildrenEnabled(View view, boolean enabled) {
2 view.setEnabled(enabled);
3 if (view instanceof ViewGroup) {
4 ViewGroup viewGroup = (ViewGroup) view;
5 for (int i = 0; i < viewGroup.getChildCount(); i++) {
6 View child = viewGroup.getChildAt(i);
7 setViewAndChildrenEnabled(child, enabled);
8 }
9 }
10}