当前位置: 首页>>代码示例>>Java>>正文


Java Color.TRANSPARENT属性代码示例

本文整理汇总了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);
    }
}
 
开发者ID:raj10071997,项目名称:Alexa-Voice-Service,代码行数:19,代码来源:CircleImageView.java

示例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);
    }
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:17,代码来源:CircleImageView.java

示例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;
  }
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:16,代码来源:WXSwipeLayout.java

示例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);
    }
}
 
开发者ID:sherlockchou86,项目名称:yphoto,代码行数:19,代码来源:CircleImageView.java

示例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;
}
 
开发者ID:milosmns,项目名称:silly-android,代码行数:30,代码来源:Coloring.java

示例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;


}
 
开发者ID:shiburagi,项目名称:Drawer-Behavior,代码行数:16,代码来源:AdvanceDrawerLayout.java

示例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);
}
 
开发者ID:customerly,项目名称:Customerly-Android-SDK,代码行数:28,代码来源:Customerly.java

示例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);
    }
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:14,代码来源:CircleImageView.java

示例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);
    }
}
 
开发者ID:li-yu,项目名称:FakeWeather,代码行数:14,代码来源:CircleImageView.java

示例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);
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:15,代码来源:CircleImageView.java

示例11: onCreate

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mHideOption = false;
    mLastColor = Color.TRANSPARENT;

}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:BrowserListOfEpisodes.java

示例12: getPlaceholder

@NonNull
public Drawable getPlaceholder() {
    return mPlaceholder != null ? mPlaceholder : new ColorDrawable(Color.TRANSPARENT);
}
 
开发者ID:Tenor-Inc,项目名称:tenor-android-core,代码行数:4,代码来源:DrawableLoaderTaskParams.java

示例13: drawBackground

private void drawBackground(Canvas canvas) {
    if (mBackgroundColor != Color.TRANSPARENT) {
        canvas.drawCircle(mCenterX, mCenterX, mRadius, mBackgroundPaint);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:CircleProgressBar.java

示例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
	);
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:46,代码来源:EditTextDecorator.java

示例15: createLineShader

protected Shader createLineShader(@ColorInt int color) {
    return new LinearGradient(axisMargin * 1.5f, 0, axisMargin * 4, 0, Color.TRANSPARENT, color, Shader.TileMode.CLAMP);
}
 
开发者ID:neXenio,项目名称:BLE-Indoor-Positioning,代码行数:3,代码来源:BeaconLineChart.java


注:本文中的android.graphics.Color.TRANSPARENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。