Example usage for android.graphics Color BLACK

List of usage examples for android.graphics Color BLACK

Introduction

In this page you can find the example usage for android.graphics Color BLACK.

Prototype

int BLACK

To view the source code for android.graphics Color BLACK.

Click Source Link

Usage

From source file:com.fa.mastodon.util.ThemeUtils.java

public static @ColorInt int getColor(Context context, @AttrRes int attribute) {
    TypedValue value = new TypedValue();
    if (context.getTheme().resolveAttribute(attribute, value, true)) {
        return value.data;
    } else {/*from  w w w. jav a2 s .  co m*/
        return Color.BLACK;
    }
}

From source file:com.google.android.apps.santatracker.doodles.tilt.ScreenBoundaryActor.java

public ScreenBoundaryActor(Polygon collisionBody) {
    super(collisionBody);
    // orange, green, semi-transparent green.
    collisionBody.setPaintColors(0xffffa500, Color.BLACK, 0x6400ff00);

    // Give ScreenBoundaryActors increasing z-indices, as these determine sort order, and
    // the behavior of ScreenBoundaryActors is based on sort order.
    zIndex = currentZIndex++;//w  w  w .  j  av  a 2 s  . c o m
}

From source file:com.jeffreyawest.weblogic.monitor.charting.DefaultPieChart.java

public DefaultPieChart() {
    mRenderer = new DefaultRenderer();
    mSeries = new CategorySeries("");

    mRenderer.setBackgroundColor(Color.BLACK);
    mRenderer.setApplyBackgroundColor(false);
    mRenderer.setExternalZoomEnabled(false);
    mRenderer.setZoomEnabled(false);/*from   w w  w .j av a  2  s  .co m*/
    mRenderer.setInScroll(false);
    mRenderer.setShowLabels(false);
    mRenderer.setShowLegend(false);
    mRenderer.setZoomButtonsVisible(false);
    mRenderer.setPanEnabled(false);
    mRenderer.setClickEnabled(false);
    mRenderer.setScale(Charting.PIE_CHART_SCALE);
    mRenderer.setLabelsColor(Color.BLACK);
    mRenderer.setStartAngle(90);

    mRenderer.setMargins(WebLogicMonitor.getInstance().getResources().getIntArray(R.array.chart_margins));

    //    mRenderer.setBackgroundColor(WebLogicMonitor.getInstance().getResources().getColor(R.color.chart_background));
    //    mRenderer.setChartTitleTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_title_size));
    //    mRenderer.setLabelsTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_label_size));
    //    mRenderer.setLegendHeight((int) WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_legend_height));
    //    mRenderer.setLegendTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_legend_text_size));
}

From source file:Main.java

/**
 * Create a Bitmap that will be used as a mask to create the preview window in the background.
 * The Bitmap will be the given width and height. The Bitmap will be transparent except for a
 * gradient on the left and bottom sides.
 *
 * @param width Width of the mask.//from   ww w . ja  va  2  s  .  c o m
 * @param height Height of the mask.
 * @param gradientSize Size of the gradient.
 * @return Bitmap mask that will be used to create a preview window.
 */
private static Bitmap createPreviewWindowMask(int width, int height, int gradientSize) {

    // Do nothing if the size is invalid
    if (width <= 0 || height <= 0) {
        return null;
    }

    // Initialize the mask
    Bitmap mask = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(mask);
    canvas.drawColor(Color.TRANSPARENT);

    // If the gradient size is zero, don't draw the gradients
    if (gradientSize <= 0) {
        return mask;
    }

    // Calculate gradient rects
    Rect leftGradientRect = new Rect(0, 0, gradientSize, height - gradientSize);
    Rect bottomGradientRect = new Rect(leftGradientRect.right, height - gradientSize, width, height);
    Rect cornerGradientRect = new Rect(leftGradientRect.left, leftGradientRect.bottom, bottomGradientRect.left,
            bottomGradientRect.bottom);

    // Create left gradient
    Paint leftGradientPaint = new Paint();
    leftGradientPaint.setDither(true);
    leftGradientPaint.setShader(new LinearGradient(leftGradientRect.left, 0, leftGradientRect.right, 0,
            Color.BLACK, Color.TRANSPARENT, Shader.TileMode.CLAMP));

    // Create right gradient
    Paint bottomGradientPaint = new Paint();
    bottomGradientPaint.setDither(true);
    bottomGradientPaint.setShader(
            new LinearGradient(leftGradientRect.right, bottomGradientRect.bottom, leftGradientRect.right,
                    bottomGradientRect.top, Color.BLACK, Color.TRANSPARENT, Shader.TileMode.CLAMP));

    // Create corner gradient
    Paint cornerGradientPaint = new Paint();
    cornerGradientPaint.setDither(true);
    cornerGradientPaint.setShader(new RadialGradient(cornerGradientRect.right, cornerGradientRect.top,
            gradientSize, Color.TRANSPARENT, Color.BLACK, Shader.TileMode.CLAMP));

    // Draw the gradients
    canvas.drawRect(leftGradientRect, leftGradientPaint);
    canvas.drawRect(bottomGradientRect, bottomGradientPaint);
    canvas.drawRect(cornerGradientRect, cornerGradientPaint);

    return mask;
}

From source file:com.brodev.socialapp.view.ImageActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ColorDrawable color = new ColorDrawable(Color.BLACK);
    color.setAlpha(128);/*from  w w  w.ja v a  2s  .  c om*/
    getSupportActionBar().setBackgroundDrawable(color);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    setContentView(R.layout.market_place_image_view);

    File cacheDir = new File(this.getCacheDir(), "imgcachedir");
    if (!cacheDir.exists())
        cacheDir.mkdir();

    Bundle bundle = getIntent().getExtras();

    String image = bundle.getString("image");
    String title = bundle.getString("title");
    getSupportActionBar().setTitle(title);

    ImageView imageView = (ImageView) findViewById(R.id.audiochatImg);

    networkUntil.drawImageUrl(imageView, image, R.drawable.loading);

    this.getWindow().setBackgroundDrawableResource(android.R.color.black);
}

From source file:com.example.accessibility.ListenerView.java

public ListenerView(Context context) {
    super(context);
    paintBlack.setColor(Color.BLACK);
    paintWhite.setColor(Color.WHITE);
    oval = new RectF(50, 40, 70, -60);

    // TODO Auto-generated constructor stub
}

From source file:edu.stanford.mobisocial.dungbeetle.model.Feed.java

public static int colorFor(String name, int alpha) {
    if (name == null)
        return Color.BLACK;
    int c = colorFor(name);
    return Color.argb(alpha, Color.red(c), Color.green(c), Color.blue(c));
}

From source file:at.wada811.android.library.demos.view.ViewPagerAdapter.java

@Override
public View instantiateItem(ViewGroup container, int position) {
    View page = mInflater.inflate(R.layout.layout_page, container, false);
    TextView textView = (TextView) page.findViewById(R.id.text);
    int rgb = position * 255;
    int r = (rgb >> 16) & 0xFF;
    int g = (rgb >> 8) & 0xFF;
    int b = rgb & 0xFF;
    r = g * 5 % 256;//w w w.j a  v a 2s  .c  o  m
    g = b * 15 % 256;
    b = r * 25 % 256;
    int argb = Color.argb(255, r, g, b);
    textView.setText(String.format("#%02X%02X%02X", r, g, b));
    textView.setTextColor(r > 192 || g > 192 || b > 192 ? Color.BLACK : Color.WHITE);
    page.setBackgroundColor(argb);
    container.addView(page);
    return page;
}

From source file:com.google.android.apps.santatracker.doodles.tilt.ToggleableBounceActor.java

public ToggleableBounceActor(Polygon collisionBody, CollisionActor onTrigger, CollisionActor offTrigger) {
    super(collisionBody);
    this.onTrigger = onTrigger;
    this.offTrigger = offTrigger;

    collisionBody.setPaintColors(Color.RED, Color.LTGRAY, 0x6400ff00);
    onTrigger.collisionBody.setPaintColors(Color.GREEN, Color.RED, 0x6400ff00);
    offTrigger.collisionBody.setPaintColors(Color.BLACK, Color.RED, 0x6400ff00);
}

From source file:biz.wiz.android.wallet.util.ViewPagerTabs.java

public ViewPagerTabs(final Context context, final AttributeSet attrs) {
    super(context, attrs);

    setSaveEnabled(true);/*from   w  w  w.ja v  a  2  s  .c o m*/

    paint.setTextSize(getResources().getDimension(R.dimen.font_size_tiny));
    paint.setColor(Color.BLACK);
    paint.setAntiAlias(true);
    paint.setShadowLayer(2, 0, 0, Color.WHITE);
}