use of android.util.TypedValue in project XobotOS by xamarin.
the class AlertController method shouldCenterSingleButton.
private static boolean shouldCenterSingleButton(Context context) {
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(com.android.internal.R.attr.alertDialogCenterButtons, outValue, true);
return outValue.data != 0;
}
use of android.util.TypedValue in project ZI by yixia.
the class UIUtils method getAttrValue.
public static TypedValue getAttrValue(Activity activity, int attrId) {
TypedValue typedValue = new TypedValue();
activity.getTheme().resolveAttribute(attrId, typedValue, true);
return typedValue;
}
use of android.util.TypedValue in project Android-skin-support by ximsfei.
the class SkinMaterialBottomNavigationView method createDefaultColorStateList.
private ColorStateList createDefaultColorStateList(int baseColorThemeAttr) {
final TypedValue value = new TypedValue();
if (!getContext().getTheme().resolveAttribute(baseColorThemeAttr, value, true)) {
return null;
}
ColorStateList baseColor = AppCompatResources.getColorStateList(getContext(), value.resourceId);
int colorPrimary = SkinCompatResources.getInstance().getColor(mDefaultTintResId);
int defaultColor = baseColor.getDefaultColor();
return new ColorStateList(new int[][] { DISABLED_STATE_SET, CHECKED_STATE_SET, EMPTY_STATE_SET }, new int[] { baseColor.getColorForState(DISABLED_STATE_SET, defaultColor), colorPrimary, defaultColor });
}
use of android.util.TypedValue in project ViewInspector by xfumihiro.
the class BaseDialog method getDialogTheme.
public static int getDialogTheme(Context context) {
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(R.attr.isLightTheme, outValue, true);
return outValue.data != 0 ? R.style.DialogThemeLight : R.style.DialogTheme;
}
use of android.util.TypedValue in project LookLook by xinghongfei.
the class ViewUtils method getActionBarSize.
public static int getActionBarSize(Context context) {
if (actionBarSize < 0) {
TypedValue value = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.actionBarSize, value, true);
actionBarSize = TypedValue.complexToDimensionPixelSize(value.data, context.getResources().getDisplayMetrics());
}
return actionBarSize;
}
Aggregations