private void enableDisableView ( View view , boolean enabled ) { view . setEnabled ( enabled ) ; view . setFocusable ( enabled ) ; if ( view instanceof ViewGroup ) { ViewGroup group = ( ViewGroup ) view ; for ( int idx = 0 ; idx < group . getChildCount ( ) ; idx ++ ) { enableDisableView ( group . getChildAt ( idx ) , enabled ) ; } } }
helper method to disable a view and all its subviews