Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

kotlin enable and disable parents view children

private static void setViewAndChildrenEnabled(View view, boolean enabled) {
    view.setEnabled(enabled);
    if (view instanceof ViewGroup) {
        ViewGroup viewGroup = (ViewGroup) view;
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            View child = viewGroup.getChildAt(i);
            setViewAndChildrenEnabled(child, enabled);
        }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #kotlin #enable #disable #parents #view #children
ADD COMMENT
Topic
Name
8+4 =