本文整理汇总了Java中android.graphics.Color.TRANSPARENT属性的典型用法代码示例。如果您正苦于以下问题:Java Color.TRANSPARENT属性的具体用法?Java Color.TRANSPARENT怎么用?Java Color.TRANSPARENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.graphics.Color
的用法示例。
在下文中一共展示了Color.TRANSPARENT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDraw
@Override
protected void onDraw(Canvas canvas) {
if (mDisableCircularTransformation) {
super.onDraw(canvas);
return;
}
if (mBitmap == null) {
return;
}
if (mFillColor != Color.TRANSPARENT) {
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mFillPaint);
}
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mBitmapPaint);
if (mBorderWidth > 0) {
canvas.drawCircle(mBorderRect.centerX(), mBorderRect.centerY(), mBorderRadius, mBorderPaint);
}
}
示例2: onDraw
@Override
protected void onDraw(Canvas canvas) {
if (mDisableCircularTransformation) {
super.onDraw(canvas);
return;
}
if (mBitmap == null) {
return;
}
if (mFillColor != Color.TRANSPARENT) {
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mFillPaint);
}
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mBitmapPaint);
if (mBorderWidth > 0) {
canvas.drawCircle(mBorderRect.centerX(), mBorderRect.centerY(), mBorderRadius, mBorderPaint);
}
}
示例3: initAttrs
private void initAttrs(Context context, AttributeSet attrs) {
if (getChildCount() > 1) {
throw new RuntimeException("WXSwipeLayout should not have more than one child");
}
parentHelper = new NestedScrollingParentHelper(this);
if (isInEditMode() && attrs == null) {
return;
}
mRefreshViewBgColor = Color.TRANSPARENT;
mProgressBgColor = Color.TRANSPARENT;
mProgressColor = Color.RED;
}
示例4: onDraw
@Override
protected void onDraw(Canvas canvas) {
if (mDisableCircularTransformation) {
super.onDraw(canvas);
return;
}
if (mBitmap == null) {
return;
}
if (mCircleBackgroundColor != Color.TRANSPARENT) {
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mCircleBackgroundPaint);
}
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mBitmapPaint);
if (mBorderWidth > 0) {
canvas.drawCircle(mBorderRect.centerX(), mBorderRect.centerY(), mBorderRadius, mBorderPaint);
}
}
示例5: createColoredDrawable
/**
* Creates a new drawable (implementation of the Drawable object may vary depending on the OS version).
* The result Drawable will be colored with the given color, and clipped to match the given bounds.
* Note that the drawable's alpha is set to 0 when argument color is {@link Color#TRANSPARENT}.
*
* @param color Integer color used to color the output drawable
* @param bounds Four-dimensional vector representing drawable bounds
* @return Colored and clipped drawable object
*/
@NonNull
public static Drawable createColoredDrawable(@ColorInt final int color, @Nullable final Rect bounds) {
// create the drawable depending on the OS (pre-Honeycomb couldn't use color drawables inside state lists)
Drawable drawable;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB || bounds != null) {
drawable = new GradientDrawable(Orientation.BOTTOM_TOP, new int[] { color, color }).mutate();
} else {
drawable = new ColorDrawable(color).mutate();
}
// set the alpha value
if (color == Color.TRANSPARENT) {
drawable.setAlpha(0);
}
// update bounds
if (bounds != null) {
drawable.setBounds(bounds);
}
return drawable;
}
示例6: setViewScale
public void setViewScale(int gravity, float percentage) {
int absGravity = getDrawerViewAbsoluteGravity(gravity);
Setting setting;
if (!settings.containsKey(absGravity)) {
setting = new Setting();
settings.put(absGravity, setting);
} else
setting = settings.get(absGravity);
setting.percentage = percentage;
setting.scrimColor = Color.TRANSPARENT;
setting.drawerElevation = 0;
}
示例7: configure
/**
* Call this method to configure the SDK indicating the Customerly App ID before accessing it.<br>
* Call this from your custom Application {@link Application#onCreate()}<br>
* <br>
* You can choose to ignore the widget_color provided by the Customerly web console for the action bar styling in support activities and use an app-local widget_color instead.
* @param pApplication The application class reference
* @param pCustomerlyAppID The Customerly App ID found in your Customerly console
* @param pWidgetColor The custom widget_color. If Color.TRANSPARENT, it will be ignored
*/
public static void configure(@NonNull Application pApplication, @NonNull String pCustomerlyAppID, @ColorInt int pWidgetColor) {
Customerly customerly = Customerly._Instance;
customerly.__init(pApplication.getApplicationContext());
final SharedPreferences prefs = customerly._SharedPreferences;
if(prefs != null) {
//noinspection SpellCheckingInspection
prefs.edit().putString("CONFIG_APP_ID", pCustomerlyAppID).putInt("CONFIG_HC_WCOLOR", pWidgetColor).apply();
}
customerly._AppID = pCustomerlyAppID.trim();
customerly.__WidgetColor__HardCoded = pWidgetColor;
customerly.__PING__LAST_widget_color = Customerly._Instance.__WidgetColor__Fallback =
pWidgetColor == Color.TRANSPARENT
? DEF_WIDGET_COLOR_MALIBU_INT
: pWidgetColor;
pApplication.registerActivityLifecycleCallbacks(customerly.__ActivityLifecycleCallbacks);
}
示例8: onDraw
@Override
protected void onDraw(Canvas canvas) {
if (mBitmap == null) {
return;
}
if (mFillColor != Color.TRANSPARENT) {
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius, mFillPaint);
}
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius, mBitmapPaint);
if (mBorderWidth != 0) {
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mBorderRadius, mBorderPaint);
}
}
示例9: onDraw
@Override
protected void onDraw(Canvas canvas) {
if (mBitmap == null) {
return;
}
if (mFillColor != Color.TRANSPARENT) {
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius+mPadding, mFillPaint);
}
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius, mBitmapPaint);
if (mBorderWidth != 0) {
canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mBorderRadius, mBorderPaint);
}
}
示例10: OvalShadow
public OvalShadow(boolean useShadow, int shadowRadius, int circleDiameter) {
super();
mShadowPaint = new Paint();
mShadowRadius = shadowRadius;
mCircleDiameter = circleDiameter;
int shadowColor = TRANSPARENT_COLOR;
if (useShadow) {
shadowColor = FILL_SHADOW_COLOR;
}
mRadialGradient = new RadialGradient(mCircleDiameter / 2, mCircleDiameter / 2,
mShadowRadius, new int[] {
shadowColor, Color.TRANSPARENT
}, null, Shader.TileMode.CLAMP);
mShadowPaint.setShader(mRadialGradient);
}
示例11: onCreate
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHideOption = false;
mLastColor = Color.TRANSPARENT;
}
示例12: getPlaceholder
@NonNull
public Drawable getPlaceholder() {
return mPlaceholder != null ? mPlaceholder : new ColorDrawable(Color.TRANSPARENT);
}
示例13: drawBackground
private void drawBackground(Canvas canvas) {
if (mBackgroundColor != Color.TRANSPARENT) {
canvas.drawCircle(mCenterX, mCenterX, mRadius, mBackgroundPaint);
}
}
示例14: applyTint
/**
* Applies current tint from {@link #mTintInfo} to the components of the attached widget.
* <p>
* <b>Note</b>, that for post {@link Build.VERSION_CODES#LOLLIPOP LOLLIPOP} this method does
* nothing.
*/
@SuppressWarnings("ConstantConditions")
private void applyTint() {
if (UiConfig.MATERIALIZED ||
mTintInfo == null ||
(!mTintInfo.hasTintList && !mTintInfo.hasTintMode)) {
return;
}
// Tint also left/right and middle selection handles. These handles can not be unfortunately
// set programmatically so we will tint directly drawables within resources.
final Resources resources = mWidget.getResources();
final Resources.Theme theme = mWidget.getContext().getTheme();
final int tintColor = mTintInfo.tintList != null ? mTintInfo.tintList.getDefaultColor() : Color.TRANSPARENT;
TintManager.tintRawDrawable(
ResourceUtils.getDrawable(
resources,
R.drawable.ui_text_select_handle_left_alpha,
theme
),
tintColor,
mTintInfo.tintMode
);
TintManager.tintRawDrawable(
ResourceUtils.getDrawable(
resources,
R.drawable.ui_text_select_handle_middle_alpha,
theme
),
tintColor,
mTintInfo.tintMode
);
TintManager.tintRawDrawable(
ResourceUtils.getDrawable(
resources,
R.drawable.ui_text_select_handle_right_alpha,
theme
),
tintColor,
mTintInfo.tintMode
);
}
示例15: createLineShader
protected Shader createLineShader(@ColorInt int color) {
return new LinearGradient(axisMargin * 1.5f, 0, axisMargin * 4, 0, Color.TRANSPARENT, color, Shader.TileMode.CLAMP);
}