本文整理汇总了Java中com.larswerkman.holocolorpicker.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.larswerkman.holocolorpicker包,在下文中一共展示了R类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.larswerkman.holocolorpicker.R; //导入依赖的package包/类
private void init(AttributeSet attrs, int defStyle) {
final TypedArray a = getContext().obtainStyledAttributes(attrs,
R.styleable.ColorBars, defStyle, 0);
final Resources b = getContext().getResources();
mBarThickness = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_thickness,
b.getDimensionPixelSize(R.dimen.bar_thickness));
mBarLength = a.getDimensionPixelSize(R.styleable.ColorBars_bar_length,
b.getDimensionPixelSize(R.dimen.bar_length));
mPreferredBarLength = mBarLength;
mBarPointerRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_radius));
mBarPointerHaloRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_halo_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_halo_radius));
mOrientation = a.getBoolean(
R.styleable.ColorBars_bar_orientation_horizontal, ORIENTATION_DEFAULT);
a.recycle();
mBarPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPaint.setShader(shader);
mBarPointerPosition = mBarLength + mBarPointerHaloRadius;
mBarPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerHaloPaint.setColor(Color.BLACK);
mBarPointerHaloPaint.setAlpha(0x50);
mBarPointerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerPaint.setColor(0xff81ff00);
mPosToSatFactor = 1 / ((float) mBarLength);
mSatToPosFactor = ((float) mBarLength) / 1;
}
示例2: init
import com.larswerkman.holocolorpicker.R; //导入依赖的package包/类
private void init(AttributeSet attrs, int defStyle) {
final TypedArray a = getContext().obtainStyledAttributes(attrs,
R.styleable.ColorBars, defStyle, 0);
final Resources b = getContext().getResources();
mBarThickness = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_thickness,
b.getDimensionPixelSize(R.dimen.bar_thickness));
mBarLength = a.getDimensionPixelSize(R.styleable.ColorBars_bar_length,
b.getDimensionPixelSize(R.dimen.bar_length));
mPreferredBarLength = mBarLength;
mBarPointerRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_radius));
mBarPointerHaloRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_halo_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_halo_radius));
mOrientation = a.getBoolean(
R.styleable.ColorBars_bar_orientation_horizontal, ORIENTATION_DEFAULT);
a.recycle();
mBarPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPaint.setShader(shader);
mBarPointerPosition = (mBarLength / 2) + mBarPointerHaloRadius;
mBarPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerHaloPaint.setColor(Color.BLACK);
mBarPointerHaloPaint.setAlpha(0x50);
mBarPointerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerPaint.setColor(0xff81ff00);
mPosToSVFactor = 1 / ((float) mBarLength / 2);
mSVToPosFactor = ((float) mBarLength / 2) / 1;
}
示例3: init
import com.larswerkman.holocolorpicker.R; //导入依赖的package包/类
private void init(AttributeSet attrs, int defStyle) {
final TypedArray a = getContext().obtainStyledAttributes(attrs,
R.styleable.ColorBars, defStyle, 0);
final Resources b = getContext().getResources();
mBarThickness = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_thickness,
b.getDimensionPixelSize(R.dimen.bar_thickness));
mBarLength = a.getDimensionPixelSize(R.styleable.ColorBars_bar_length,
b.getDimensionPixelSize(R.dimen.bar_length));
mPreferredBarLength = mBarLength;
mBarPointerRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_radius));
mBarPointerHaloRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_halo_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_halo_radius));
mOrientation = a.getBoolean(
R.styleable.ColorBars_bar_orientation_horizontal, ORIENTATION_DEFAULT);
a.recycle();
mBarPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPaint.setShader(shader);
mBarPointerPosition = mBarPointerHaloRadius;
mBarPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerHaloPaint.setColor(Color.BLACK);
mBarPointerHaloPaint.setAlpha(0x50);
mBarPointerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerPaint.setColor(0xff81ff00);
mPosToSatFactor = 1 / ((float) mBarLength);
mSatToPosFactor = ((float) mBarLength) / 1;
}
示例4: init
import com.larswerkman.holocolorpicker.R; //导入依赖的package包/类
private void init(AttributeSet attrs, int defStyle) {
final TypedArray a = getContext().obtainStyledAttributes(attrs,
R.styleable.ColorBars, defStyle, 0);
final Resources b = getContext().getResources();
mBarThickness = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_thickness,
b.getDimensionPixelSize(R.dimen.bar_thickness));
mBarLength = a.getDimensionPixelSize(R.styleable.ColorBars_bar_length,
b.getDimensionPixelSize(R.dimen.bar_length));
mPreferredBarLength = mBarLength;
mBarPointerRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_radius));
mBarPointerHaloRadius = a.getDimensionPixelSize(
R.styleable.ColorBars_bar_pointer_halo_radius,
b.getDimensionPixelSize(R.dimen.bar_pointer_halo_radius));
mOrientation = a.getBoolean(
R.styleable.ColorBars_bar_orientation_horizontal, ORIENTATION_DEFAULT);
a.recycle();
mBarPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPaint.setShader(shader);
mBarPointerPosition = mBarLength + mBarPointerHaloRadius;
mBarPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerHaloPaint.setColor(Color.BLACK);
mBarPointerHaloPaint.setAlpha(0x50);
mBarPointerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBarPointerPaint.setColor(0xff81ff00);
mPosToOpacFactor = 0xFF / ((float) mBarLength);
mOpacToPosFactor = ((float) mBarLength) / 0xFF;
}
示例5: init
import com.larswerkman.holocolorpicker.R; //导入依赖的package包/类
private void init(AttributeSet attrs, int defStyle) {
final TypedArray a = getContext().obtainStyledAttributes(attrs,
R.styleable.ColorPicker, defStyle, 0);
final Resources b = getContext().getResources();
mColorWheelThickness = a.getDimensionPixelSize(
R.styleable.ColorPicker_color_wheel_thickness,
b.getDimensionPixelSize(R.dimen.color_wheel_thickness));
mColorWheelRadius = a.getDimensionPixelSize(
R.styleable.ColorPicker_color_wheel_radius,
b.getDimensionPixelSize(R.dimen.color_wheel_radius));
mPreferredColorWheelRadius = mColorWheelRadius;
mColorCenterRadius = a.getDimensionPixelSize(
R.styleable.ColorPicker_color_center_radius,
b.getDimensionPixelSize(R.dimen.color_center_radius));
mPreferredColorCenterRadius = mColorCenterRadius;
mColorCenterHaloRadius = a.getDimensionPixelSize(
R.styleable.ColorPicker_color_center_halo_radius,
b.getDimensionPixelSize(R.dimen.color_center_halo_radius));
mPreferredColorCenterHaloRadius = mColorCenterHaloRadius;
mColorPointerRadius = a.getDimensionPixelSize(
R.styleable.ColorPicker_color_pointer_radius,
b.getDimensionPixelSize(R.dimen.color_pointer_radius));
mColorPointerHaloRadius = a.getDimensionPixelSize(
R.styleable.ColorPicker_color_pointer_halo_radius,
b.getDimensionPixelSize(R.dimen.color_pointer_halo_radius));
a.recycle();
mAngle = (float) (-Math.PI / 2);
Shader s = new SweepGradient(0, 0, COLORS, null);
mColorWheelPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mColorWheelPaint.setShader(s);
mColorWheelPaint.setStyle(Paint.Style.STROKE);
mColorWheelPaint.setStrokeWidth(mColorWheelThickness);
mPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mPointerHaloPaint.setColor(Color.BLACK);
mPointerHaloPaint.setAlpha(0x50);
mPointerColor = new Paint(Paint.ANTI_ALIAS_FLAG);
mPointerColor.setColor(calculateColor(mAngle));
mCenterNewPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mCenterNewPaint.setColor(calculateColor(mAngle));
mCenterNewPaint.setStyle(Paint.Style.FILL);
mCenterOldPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mCenterOldPaint.setColor(calculateColor(mAngle));
mCenterOldPaint.setStyle(Paint.Style.FILL);
mCenterHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mCenterHaloPaint.setColor(Color.BLACK);
mCenterHaloPaint.setAlpha(0x00);
mCenterNewColor = calculateColor(mAngle);
mCenterOldColor = calculateColor(mAngle);
mShowCenterOldColor = true;
}