Java Code Examples for android.graphics.Color.TRANSPARENT

The following are Jave code examples for showing how to use TRANSPARENT of the android.graphics.Color class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Alexa-Voice-Service   File: CircleImageView.java   Source Code and License Vote up 6 votes
@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);
    }
}
 
Example 2
Project: CircleImageView   File: CircleImageView.java   Source Code and License Vote up 6 votes
@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);
    }
}
 
Example 3
Project: Sega   File: CircleImageView.java   Source Code and License Vote up 6 votes
@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);
    }
}
 
Example 4
Project: weex-uikit   File: WXSwipeLayout.java   Source Code and License Vote up 6 votes
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;
  }
 
Example 5
Project: yphoto   File: CircleImageView.java   Source Code and License Vote up 6 votes
@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);
    }
}
 
Example 6
Project: silly-android   File: Coloring.java   Source Code and License Vote up 6 votes
/**
 * 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;
}
 
Example 7
Project: Drawer-Behavior   File: AdvanceDrawerLayout.java   Source Code and License Vote up 6 votes
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;


}
 
Example 8
Project: Customerly-Android-SDK   File: Customerly.java   Source Code and License Vote up 6 votes
/**
 * 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);
}
 
Example 9
Project: sealtalk-android-master   File: CircleImageView.java   Source Code and License Vote up 5 votes
@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);
    }
}
 
Example 10
Project: FakeWeather   File: CircleImageView.java   Source Code and License Vote up 5 votes
@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);
    }
}
 
Example 11
Project: RoadLab-Pro   File: CircleImageView.java   Source Code and License Vote up 5 votes
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);
}
 
Example 12
Project: aos-Video   File: BrowserListOfEpisodes.java   Source Code and License Vote up 4 votes
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mHideOption = false;
    mLastColor = Color.TRANSPARENT;

}
 
Example 13
Project: tenor-android-core   File: DrawableLoaderTaskParams.java   Source Code and License Vote up 4 votes
@NonNull
public Drawable getPlaceholder() {
    return mPlaceholder != null ? mPlaceholder : new ColorDrawable(Color.TRANSPARENT);
}
 
Example 14
Project: GitHub   File: CircleProgressBar.java   Source Code and License Vote up 4 votes
private void drawBackground(Canvas canvas) {
    if (mBackgroundColor != Color.TRANSPARENT) {
        canvas.drawCircle(mCenterX, mCenterX, mRadius, mBackgroundPaint);
    }
}
 
Example 15
Project: android_ui   File: EditTextDecorator.java   Source Code and License Vote up 4 votes
/**
 * 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
	);
}
 
Example 16
Project: BLE-Indoor-Positioning   File: BeaconLineChart.java   Source Code and License Vote up 4 votes
protected Shader createLineShader(@ColorInt int color) {
    return new LinearGradient(axisMargin * 1.5f, 0, axisMargin * 4, 0, Color.TRANSPARENT, color, Shader.TileMode.CLAMP);
}
 
Example 17
Project: Mix   File: ThemeUtils.java   Source Code and License Vote up 4 votes
static
@ColorInt
int replaceColor(Context context, @ColorInt int color) {
    return mSwitchColor == null ? Color.TRANSPARENT : mSwitchColor.replaceColor(context, color);
}
 
Example 18
Project: RNLearn_Project1   File: ReactHorizontalScrollViewManager.java   Source Code and License Vote up 2 votes
/**
 * When set, fills the rest of the scrollview with a color to avoid setting a background and
 * creating unnecessary overdraw.
 * @param view
 * @param color
 */
@ReactProp(name = "endFillColor", defaultInt = Color.TRANSPARENT, customType = "Color")
public void setBottomFillColor(ReactHorizontalScrollView view, int color) {
  view.setEndFillColor(color);
}
 
Example 19
Project: ChenYan   File: ClickableSpanEx.java   Source Code and License Vote up 2 votes
/**
 * New ClickableSpanEx instance .
 *
 * @param foregroundColor foreground color
 */
public ClickableSpanEx(int foregroundColor) {
    this(foregroundColor, Color.TRANSPARENT);
}
 
Example 20
Project: Coder   File: ImmersionBar.java   Source Code and License Vote up 2 votes
/**
 * 透明状态栏,默认透明
 *
 * @return the immersion bar
 */
public ImmersionBar transparentStatusBar() {
    mBarParams.statusBarColor = Color.TRANSPARENT;
    return this;
}