Answers for "direct subclass of viewgroup"

1

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);
        }
    }
}
Posted by: Guest on May-11-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language