use of android.content.res.TypedArray in project enroscar by stanfy.
the class ImageView method init.
private void init(final Context context, final AttributeSet attrs) {
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ImageView);
final int cornersRadius = a.getDimensionPixelSize(R.styleable.ImageView_android_radius, 0);
a.recycle();
setCornersRadius(cornersRadius);
}
use of android.content.res.TypedArray in project Rutgers-Course-Tracker by tevjef.
the class Utils method fetchPrimaryDarkColor.
public static int fetchPrimaryDarkColor(Resources.Theme context) {
TypedValue typedValue = new TypedValue();
TypedArray a = context.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorPrimaryDark });
int color = a.getColor(0, 0);
a.recycle();
return color;
}
use of android.content.res.TypedArray in project Rutgers-Course-Tracker by tevjef.
the class StringPicker method initAttributes.
private void initAttributes(Context context, AttributeSet attrs) {
themeColors = resolveColors(context);
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.StringPicker, 0, 0);
try {
mDividerColor = a.getInt(R.styleable.StringPicker_sp__dividerColor, themeColors.accentColor);
//http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.2_r1/android/widget/NumberPicker.java#NumberPicker.0UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT
mDividerHeight = a.getDimensionPixelSize(R.styleable.StringPicker_sp__dividerHeight, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics()));
} finally {
a.recycle();
}
}
use of android.content.res.TypedArray in project BGAQRCode-Android by bingoogolapple.
the class ScanBoxView method initCustomAttrs.
public void initCustomAttrs(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.QRCodeView);
final int count = typedArray.getIndexCount();
for (int i = 0; i < count; i++) {
initCustomAttr(typedArray.getIndex(i), typedArray);
}
typedArray.recycle();
afterInitCustomAttrs();
}
use of android.content.res.TypedArray in project BGABanner-Android by bingoogolapple.
the class BGABanner method initCustomAttrs.
private void initCustomAttrs(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.BGABanner);
final int N = typedArray.getIndexCount();
for (int i = 0; i < N; i++) {
initCustomAttr(typedArray.getIndex(i), typedArray);
}
typedArray.recycle();
}
Aggregations