0
I would like to standardize the views, some screens to view and edit and others just to view. In view mode I leave the views disabled.
I’m trying to keep the appearance similar, 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);
}
}
}
setFocusable(false)
– user28595
Almost! But it has the toggle-button that keeps working.
– Rodrigo Santiago