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:net.reichholf.dreamdroid.activities.ScreenShotActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    super.onCreate(savedInstanceState);
    setTitle(getText(R.string.app_name) + " - " + getText(R.string.screenshot));

    mImageView = new ImageView(this);
    setContentView(mImageView);/*www.  ja  v  a 2  s .c o  m*/
    mImageView.setBackgroundColor(Color.BLACK);

    Bundle extras = getIntent().getExtras();

    if (extras == null) {
        extras = new Bundle();
    }

    mType = extras.getInt(KEY_TYPE, TYPE_ALL);
    mFormat = extras.getInt(KEY_FORMAT, FORMAT_PNG);
    mSize = extras.getInt(KEY_SIZE, 720);
    mFilename = extras.getString(KEY_FILENAME);

    reload();
}

From source file:com.esminis.server.library.dialog.about.AboutViewImpl.java

@Override
public void setupOnShow() {
    final Button button = getButton(DialogInterface.BUTTON_NEGATIVE);
    final ViewGroup.LayoutParams params = button.getLayoutParams();
    button.setTextColor(Color.BLACK);
    button.setTextSize(TypedValue.COMPLEX_UNIT_PX,
            getContext().getResources().getDimensionPixelSize(R.dimen.dialog_button_font_size));
    button.setGravity(Gravity.CENTER);//from  w ww. ja  v  a  2  s  . com
    params.width = ViewGroup.LayoutParams.MATCH_PARENT;
    button.setLayoutParams(params);
}

From source file:com.github.refreshloadlayout.ProgressView.java

private void init(Context context) {
    final float density = context.getResources().getDisplayMetrics().density;
    mShadowRadius = (int) (density * SHADOW_RADIUS);
    mProgressStokeWidth = (int) (STROKE_WIDTH_LARGE * density);
    mArrowWidth = -1;/*  w  w  w. j  a  v  a  2s . c  o m*/
    mArrowHeight = -1;
    mTextSize = (int) (DEFAULT_TEXT_SIZE * density);
    mTextColor = Color.BLACK;
    mShowArrow = true;
    mCircleBackgroundEnabled = true;
    mProgress = 0;
    mMax = 100;

    mTextPaint = new Paint();
    mTextPaint.setStyle(Paint.Style.FILL);
    mTextPaint.setColor(mTextColor);
    mTextPaint.setTextSize(mTextSize);
    mTextPaint.setAntiAlias(true);
    mProgressDrawable = new MaterialProgressDrawable(getContext(), this);
    super.setImageDrawable(mProgressDrawable);
}

From source file:am.widget.MaterialProgressImageView.java

private void initView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    final float density = getResources().getDisplayMetrics().density;
    ArrayList<Integer> colors = new ArrayList<>();
    TypedArray custom = context.obtainStyledAttributes(attrs, R.styleable.MaterialProgressImageView,
            defStyleAttr, defStyleRes);//w w  w. j av  a  2 s. c o m
    boolean autoStart = custom.getBoolean(R.styleable.MaterialProgressImageView_mpiAutoStart, true);
    int color = custom.getColor(R.styleable.MaterialProgressImageView_mpiShadowsCircleColor, DEFAULT_COLOR);
    float elevation = custom.getDimension(R.styleable.MaterialProgressImageView_mpiElevation,
            density * SHADOW_ELEVATION);
    if (custom.hasValue(R.styleable.MaterialProgressImageView_mpiSchemeColor1)) {
        colors.add(custom.getColor(R.styleable.MaterialProgressImageView_mpiSchemeColor1, Color.BLACK));
    }
    if (custom.hasValue(R.styleable.MaterialProgressImageView_mpiSchemeColor2)) {
        colors.add(custom.getColor(R.styleable.MaterialProgressImageView_mpiSchemeColor2, Color.BLACK));
    }
    if (custom.hasValue(R.styleable.MaterialProgressImageView_mpiSchemeColor3)) {
        colors.add(custom.getColor(R.styleable.MaterialProgressImageView_mpiSchemeColor3, Color.BLACK));
    }
    if (custom.hasValue(R.styleable.MaterialProgressImageView_mpiSchemeColor4)) {
        colors.add(custom.getColor(R.styleable.MaterialProgressImageView_mpiSchemeColor4, Color.BLACK));
    }
    if (custom.hasValue(R.styleable.MaterialProgressImageView_mpiSchemeColor5)) {
        colors.add(custom.getColor(R.styleable.MaterialProgressImageView_mpiSchemeColor5, Color.BLACK));
    }
    custom.recycle();
    setElevationCompat(elevation);
    Drawable background = getBackground();
    if (background == null)
        setShadowsCircleBackground(color);
    drawable = new MaterialProgressDrawable(density);
    drawable.setBackgroundColor(0x00000000);
    drawable.setAlpha(255);
    drawable.setCallback(this);
    final int size = colors.size();
    if (size > 0) {
        int[] colorArray = new int[size];
        for (int i = 0; i < size; i++) {
            colorArray[i] = colors.get(i);
        }
        drawable.setColorSchemeColors(colorArray);
    }
    setImageDrawable(drawable);
    if (autoStart)
        start();
}

From source file:cc.kenai.common.AnimatedSvgView.java

private void init(Context context, AttributeSet attrs) {
    mFillPaint = new Paint();
    mFillPaint.setAntiAlias(true);// ww  w  .  ja v  a  2 s. co m
    mFillPaint.setStyle(Paint.Style.FILL);

    mMarkerLength = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MARKER_LENGTH_DIP,
            getResources().getDisplayMetrics());

    mTraceColors = new int[1];
    mTraceColors[0] = Color.BLACK;
    mTraceResidueColors = new int[1];
    mTraceResidueColors[0] = Color.argb(50, 0, 0, 0);

    if (attrs != null) {
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AnimatedSvgView);

        mViewportWidth = a.getInt(R.styleable.AnimatedSvgView_oakSvgImageSizeX, 433);
        Log.i(TAG, "mViewportWidth=" + mViewportWidth);
        mRatioSizingInfo.aspectRatioWidth = a.getInt(R.styleable.AnimatedSvgView_oakSvgImageSizeX, 433);
        mViewportHeight = a.getInt(R.styleable.AnimatedSvgView_oakSvgImageSizeY, 433);
        mRatioSizingInfo.aspectRatioHeight = a.getInt(R.styleable.AnimatedSvgView_oakSvgImageSizeY, 433);

        mTraceTime = a.getInt(R.styleable.AnimatedSvgView_oakSvgTraceTime, 2000);
        mTraceTimePerGlyph = a.getInt(R.styleable.AnimatedSvgView_oakSvgTraceTimePerGlyph, 1000);
        mFillStart = a.getInt(R.styleable.AnimatedSvgView_oakSvgFillStart, 1200);
        mFillTime = a.getInt(R.styleable.AnimatedSvgView_oakSvgFillTime, 1000);

        a.recycle();

        mViewport = new PointF(mViewportWidth, mViewportHeight);
    }
    loadConfig();
}

From source file:com.blogspot.ksoichiro.viewIndicator.ViewIndicator.java

@SuppressLint("DrawAllocation")
@Override//from   w  w  w. j  a  v  a  2 s. c o m
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    Paint paint = new Paint();
    paint.setStrokeWidth(1);
    paint.setStrokeCap(Paint.Cap.ROUND);
    paint.setColor(Color.BLACK);
    paint.setAntiAlias(true);

    for (int i = 0; i < mNumOfViews; i++) {
        float cx = (getWidth() - (mNumOfViews - 1) * DISTANCE) / 2 + i * DISTANCE;
        float cy = getHeight() / 2.0f;
        if (mPosition == i) {
            paint.setStyle(Paint.Style.FILL_AND_STROKE);
        } else {
            paint.setStyle(Paint.Style.STROKE);
        }
        canvas.drawCircle(cx, cy, RADIUS, paint);
    }
}

From source file:master.flame.danmaku.danmaku.parser.android.AcFunDanmakuParser.java

private Danmakus _parse(JSONArray jsonArray, Danmakus danmakus) {
    if (danmakus == null) {
        danmakus = new Danmakus();
    }//from   w ww .  ja v a2  s .c o  m
    if (jsonArray == null || jsonArray.length() == 0) {
        return danmakus;
    }
    for (int i = 0; i < jsonArray.length(); i++) {
        try {
            JSONObject obj = jsonArray.getJSONObject(i);
            String c = obj.getString("c");
            String[] values = c.split(",");
            if (values.length > 0) {
                int type = Integer.parseInt(values[2]); // 
                if (type == 7)
                    // FIXME : hard code
                    // TODO : parse advance danmaku json
                    continue;
                long time = (long) (Float.parseFloat(values[0]) * 1000); // 
                int color = Integer.parseInt(values[1]) | 0xFF000000; // 
                float textSize = Float.parseFloat(values[3]); // ?
                BaseDanmaku item = DanmakuFactory.createDanmaku(type, mDisp);
                if (item != null) {
                    item.time = time;
                    item.textSize = textSize * (mDispDensity - 0.6f);
                    item.textColor = color;
                    item.textShadowColor = color <= Color.BLACK ? Color.WHITE : Color.BLACK;
                    DanmakuFactory.fillText(item, obj.optString("m", "...."));
                    item.index = i;
                    item.setTimer(mTimer);
                    danmakus.addItem(item);
                }
            }
        } catch (JSONException e) {
        } catch (NumberFormatException e) {
        }
    }
    return danmakus;
}

From source file:com.rks.musicx.ui.adapters.QueueAdapter.java

@Override
public void onBindViewHolder(QueueViewHolder holder, int position) {
    Song song = getItem(position);/*  w ww.j  av a  2 s. co  m*/
    int accentColor = Config.accentColor(getContext(), Helper.getATEKey(getContext()));
    if (mLayoutId == R.layout.song_list) {
        if (position == pos) {
            holder.itemView.setSelected(true);
            highLight(holder, accentColor, accentColor);
        } else {
            holder.itemView.setSelected(false);
            highLight(holder, Color.WHITE, Color.BLACK);
        }
        holder.SongTitle.setText(song.getTitle());
        holder.SongArtist.setText(song.getArtist());
        ArtworkUtils.ArtworkLoader(getContext(), 300, 600, song.getAlbum(), song.getAlbumId(), new palette() {
            @Override
            public void palettework(Palette palette) {
            }
        }, holder.queueArtwork);
        holder.menu.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_menu));
        holder.queueArtwork.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN) {
                    mDragStartListener.onStartDrag(holder);
                }
                return false;
            }
        });
        if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
            holder.SongArtist.setTextColor(ContextCompat.getColor(getContext(), R.color.darkthemeTextColor));
            holder.menu.getDrawable().setTint(Color.WHITE);
        } else {
            holder.menu.getDrawable().setTint(Color.WHITE);
            holder.SongArtist.setTextColor(Color.WHITE);
            if (Extras.getInstance().getPlayingViewTrack()) {
                holder.menu.getDrawable().setTint(ContextCompat.getColor(getContext(), R.color.MaterialGrey));
                holder.SongArtist.setTextColor(Color.DKGRAY);
            }
        }
    }
    if (mLayoutId == R.layout.gridqueue) {
        ArtworkUtils.ArtworkLoader(getContext(), 300, 600, song.getAlbum(), song.getAlbumId(), new palette() {
            @Override
            public void palettework(Palette palette) {
            }
        }, holder.queueArtworkgrid);
    }
}

From source file:com.example.mapdemo.PolygonDemoActivity.java

private void setUpMap() {
    // Create a rectangle with two rectangular holes.
    mMap.addPolygon(new PolygonOptions().addAll(createRectangle(new LatLng(-20, 130), 5, 5))
            .addHole(createRectangle(new LatLng(-22, 128), 1, 1))
            .addHole(createRectangle(new LatLng(-18, 133), 0.5, 1.5)).fillColor(Color.CYAN)
            .strokeColor(Color.BLUE).strokeWidth(5));

    // Create a rectangle centered at Sydney.
    PolygonOptions options = new PolygonOptions().addAll(createRectangle(SYDNEY, 5, 8));

    int fillColor = Color.HSVToColor(mAlphaBar.getProgress(), new float[] { mColorBar.getProgress(), 1, 1 });
    mMutablePolygon = mMap.addPolygon(/*from  ww  w . ja  va  2 s  . c  o  m*/
            options.strokeWidth(mWidthBar.getProgress()).strokeColor(Color.BLACK).fillColor(fillColor));

    mColorBar.setOnSeekBarChangeListener(this);
    mAlphaBar.setOnSeekBarChangeListener(this);
    mWidthBar.setOnSeekBarChangeListener(this);

    // Move the map so that it is centered on the mutable polygon.
    mMap.moveCamera(CameraUpdateFactory.newLatLng(SYDNEY));
}

From source file:com.devspark.sidenavigation.meiriyiwen.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);
    icon = (ImageView) findViewById(android.R.id.icon);
    sideNavigationView = (SideNavigationView) findViewById(R.id.side_navigation_view);
    sideNavigationView.setMenuItems(R.menu.side_navigation_menu);
    sideNavigationView.setMenuClickCallback(this);

    if (getIntent().hasExtra(EXTRA_TITLE)) {
        String title = getIntent().getStringExtra(EXTRA_TITLE);
        int resId = getIntent().getIntExtra(EXTRA_RESOURCE_ID, 0);
        setTitle(title);/*from ww w  .j  a  v  a  2 s.com*/
        icon.setImageResource(resId);
        sideNavigationView.setMode(getIntent().getIntExtra(EXTRA_MODE, 0) == 0 ? Mode.LEFT : Mode.RIGHT);
    }

    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites()
            .detectNetwork().penaltyLog().build());
    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects()
            .detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());
    {
        String title = "http://meiriyiwen.com/index/mobile";
        //setTitle(title);
        WebView uiwebview = (WebView) findViewById(R.id.meiriyiwenWeb);
        uiwebview.setBackgroundColor(Color.BLACK);
        uiwebview.setWebViewClient(new Callback());
        uiwebview.getSettings().setBuiltInZoomControls(true);
        uiwebview.getSettings().setJavaScriptEnabled(true);
        uiwebview.loadUrl(title);

    }

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

}