@Test public void getThemeColorControlNormal_whenOnPostLollipopConfig_getsNonzeroColor() { @ColorInt int color = ViewUtils.getThemeColorControlNormal(mActivityController.get()).data; assertTrue(Color.alpha(color) > 0); }
static TypedValue getThemeColorControlNormal(Context context) { int colorAttr; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { colorAttr = android.R.attr.colorControlNormal; } else { colorAttr = context .getResources() .getIdentifier("colorControlNormal", "attr", context.getPackageName()); } TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(colorAttr, outValue, true); return outValue; }
ViewUtils { static TypedValue getThemeColorControlNormal(Context context) { int colorAttr; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { colorAttr = android.R.attr.colorControlNormal; } else { colorAttr = context .getResources() .getIdentifier("colorControlNormal", "attr", context.getPackageName()); } TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(colorAttr, outValue, true); return outValue; } }
ViewUtils { static TypedValue getThemeColorControlNormal(Context context) { int colorAttr; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { colorAttr = android.R.attr.colorControlNormal; } else { colorAttr = context .getResources() .getIdentifier("colorControlNormal", "attr", context.getPackageName()); } TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(colorAttr, outValue, true); return outValue; }  }
ViewUtils { static TypedValue getThemeColorControlNormal(Context context) { int colorAttr; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { colorAttr = android.R.attr.colorControlNormal; } else { colorAttr = context .getResources() .getIdentifier("colorControlNormal", "attr", context.getPackageName()); } TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(colorAttr, outValue, true); return outValue; }   }
ViewUtils { static TypedValue getThemeColorControlNormal(Context context) { int colorAttr; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { colorAttr = android.R.attr.colorControlNormal; } else { colorAttr = context .getResources() .getIdentifier("colorControlNormal", "attr", context.getPackageName()); } TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(colorAttr, outValue, true); return outValue; }    }