(ViewGroup view, boolean enabled)
| 2211 | } |
| 2212 | |
| 2213 | static void setViewsEnabled(ViewGroup view, boolean enabled) { |
| 2214 | for (int i = 0; i < view.getChildCount(); i++) { |
| 2215 | View child = view.getChildAt(i); |
| 2216 | if ("ignore".equals(child.getTag())) |
| 2217 | continue; |
| 2218 | if (child instanceof Spinner || |
| 2219 | child instanceof EditText || |
| 2220 | child instanceof CheckBox || |
| 2221 | child instanceof ImageView /* =ImageButton */ || |
| 2222 | child instanceof RadioButton || |
| 2223 | (child instanceof Button && "disable".equals(child.getTag()))) { |
| 2224 | if (child instanceof ImageView && ((ImageView) child).getImageTintList() != null) |
| 2225 | child.setAlpha(enabled ? 1.0f : LOW_LIGHT); |
| 2226 | child.setEnabled(enabled); |
| 2227 | } else if (child instanceof BottomNavigationView) { |
| 2228 | Menu menu = ((BottomNavigationView) child).getMenu(); |
| 2229 | menu.setGroupEnabled(0, enabled); |
| 2230 | } else if (child instanceof RecyclerView) |
| 2231 | ; // do nothing |
| 2232 | else if (child instanceof ViewGroup) |
| 2233 | setViewsEnabled((ViewGroup) child, enabled); |
| 2234 | } |
| 2235 | } |
| 2236 | |
| 2237 | static void hide(View view) { |
| 2238 | view.setPadding(1, 1, 0, 0); |
no test coverage detected