Created
May 10, 2018 15:26
-
-
Save javymarmol/9a4a1f04a4afaccf7cc014813828b58b to your computer and use it in GitHub Desktop.
enable o disable view in android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void enableDisableView(View view, boolean enabled) { | |
view.setEnabled(enabled); | |
if ( view instanceof ViewGroup ) { | |
ViewGroup group = (ViewGroup)view; | |
for ( int idx = 0 ; idx < group.getChildCount() ; idx++ ) { | |
enableDisableView(group.getChildAt(idx), enabled); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment