I'd like to standardize views, some screens to view and edit, and others to view. In view mode I leave the views disabled.
I'm trying to keep looking similar by using the following code:
private void enableControls(boolean enable, ViewGroup vg){
for (int i = 0; i < vg.getChildCount(); i++){
View child = vg.getChildAt(i);
child.setEnabled(enable);
if(enable)
child.setAlpha(1);
else
child.setAlpha(.9f);
if (child instanceof ViewGroup){
enableControls(enable, (ViewGroup) child);
}
}
}