MCPcopy Create free account
hub / github.com/M66B/FairEmail / setViewsEnabled

Method setViewsEnabled

app/src/main/java/eu/faircode/email/Helper.java:2213–2235  ·  view source on GitHub ↗
(ViewGroup view, boolean enabled)

Source from the content-addressed store, hash-verified

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);

Callers 15

onCreateViewMethod · 0.95
onCreateDialogMethod · 0.95
onChangedMethod · 0.95
onCreateViewMethod · 0.95
onPreExecuteMethod · 0.95
onPostExecuteMethod · 0.95
onExecutedMethod · 0.95
onPreExecuteMethod · 0.95
onPostExecuteMethod · 0.95
onPreExecuteMethod · 0.95
onPostExecuteMethod · 0.95
onCreateViewMethod · 0.95

Calls 3

getTagMethod · 0.80
equalsMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected