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:cc.chenghong.vkagetorder.material.CircleProgressBar.java

private void init(Context context, AttributeSet attrs, int defStyleAttr) {
    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar, defStyleAttr, 0);

    final float density = getContext().getResources().getDisplayMetrics().density;

    mBackGroundColor = a.getColor(R.styleable.CircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT);

    mProgressColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT);
    mColors = new int[] { mProgressColor };

    mInnerRadius = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_inner_radius, -1);

    mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_stoke_width,
            (int) (STROKE_WIDTH_LARGE * density));
    mArrowWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_width, -1);
    mArrowHeight = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_height, -1);
    mTextSize = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_text_size,
            (int) (DEFAULT_TEXT_SIZE * density));
    mTextColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_text_color, Color.BLACK);

    mShowArrow = a.getBoolean(R.styleable.CircleProgressBar_mlpb_show_arrow, false);
    mCircleBackgroundEnabled = a.getBoolean(R.styleable.CircleProgressBar_mlpb_enable_circle_background, true);

    mProgress = a.getInt(R.styleable.CircleProgressBar_mlpb_progress, 0);
    mMax = a.getInt(R.styleable.CircleProgressBar_mlpb_max, 100);
    int textVisible = a.getInt(R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1);
    if (textVisible != 1) {
        mIfDrawText = true;/*from  ww  w.j a v  a 2 s  .  co m*/
    }

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

From source file:com.itutorgroup.tutorchat.phone.ui.CircleProgressBar.java

private void init(Context context, AttributeSet attrs, int defStyleAttr) {
    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar, defStyleAttr, 0);
    final float density = getContext().getResources().getDisplayMetrics().density;

    mBackGroundColor = a.getColor(R.styleable.CircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT);

    mProgressColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT);//ToDO 

    mInnerRadius = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_inner_radius, -1);

    mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_stoke_width,
            (int) (STROKE_WIDTH_LARGE * density));
    mArrowWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_width, -1);
    mArrowHeight = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_height, -1);
    mTextSize = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_text_size,
            (int) (DEFAULT_TEXT_SIZE * density));
    mTextColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_text_color, Color.BLACK);

    mShowArrow = a.getBoolean(R.styleable.CircleProgressBar_mlpb_show_arrow, false);
    mCircleBackgroundEnabled = a.getBoolean(R.styleable.CircleProgressBar_mlpb_enable_circle_background, true);

    mProgress = a.getInt(R.styleable.CircleProgressBar_mlpb_progress, 0);
    mMax = a.getInt(R.styleable.CircleProgressBar_mlpb_max, 100);
    int textVisible = a.getInt(R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1);
    if (textVisible != 1) {
        mIfDrawText = true;//from   ww  w.j  a v  a 2 s. co m
    }

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

From source file:com.rks.musicx.misc.utils.Sleeptimer.java

public static void showTimerInfo(Activity c) {
    final String Continue = c.getString(R.string.Continue);
    final String cancelTimer = c.getString(R.string.cancel_timer);
    if (mTask.getDelay(TimeUnit.MILLISECONDS) < 0) {
        Stop();/*from  www.  j  av a2  s.  c  o  m*/
        return;
    }
    View view = LayoutInflater.from(c).inflate(R.layout.timer_info, null);
    final TextView timeLeft = ((TextView) view.findViewById(R.id.time_left));
    if (PreferenceManager.getDefaultSharedPreferences(c).getBoolean("dark_theme", false)) {
        timeLeft.setTextColor(Color.WHITE);
    } else {
        timeLeft.setTextColor(Color.BLACK);
    }
    final String stopTimer = c.getString(R.string.stop_timer);

    MaterialDialog.Builder sleepdialog = new MaterialDialog.Builder(c);
    sleepdialog.title("SleepTimer");
    sleepdialog.positiveText(Continue);
    sleepdialog.onPositive(new MaterialDialog.SingleButtonCallback() {
        @Override
        public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
            sleepdialog.autoDismiss(true);
        }
    });
    sleepdialog.negativeText(cancelTimer);
    sleepdialog.onNegative(new MaterialDialog.SingleButtonCallback() {
        @Override
        public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
            Stop();
            Toast.makeText(c, stopTimer, Toast.LENGTH_LONG).show();
        }
    });
    sleepdialog.customView(view, false);
    new CountDownTimer(mTask.getDelay(TimeUnit.MILLISECONDS), 1000) {
        @SuppressLint("StringFormatInvalid")
        @Override
        public void onTick(long seconds) {
            long miliseconds = seconds;
            miliseconds = miliseconds / 1000;
            timeLeft.setText(String.format(c.getString(R.string.timer_info), ((miliseconds % 3600) / 60),
                    ((miliseconds % 3600) % 60)));
        }

        @Override
        public void onFinish() {
            sleepdialog.autoDismiss(true);
        }
    }.start();
    sleepdialog.show();
}

From source file:com.eventer.app.view.CircleProgressBar.java

private void init(Context context, AttributeSet attrs, int defStyleAttr) {
    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar, defStyleAttr, 0);
    final float density = getContext().getResources().getDisplayMetrics().density;

    mBackGroundColor = a.getColor(R.styleable.CircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT);

    mProgressColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT);
    mColors = new int[] { mProgressColor };

    mInnerRadius = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_inner_radius, -1);

    mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_stoke_width,
            (int) (STROKE_WIDTH_LARGE * density));
    mArrowWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_width, -1);
    mArrowHeight = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_height, -1);
    mTextSize = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_text_size,
            (int) (DEFAULT_TEXT_SIZE * density));
    mTextColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_text_color, Color.BLACK);

    mShowArrow = a.getBoolean(R.styleable.CircleProgressBar_mlpb_show_arrow, false);
    mCircleBackgroundEnabled = a.getBoolean(R.styleable.CircleProgressBar_mlpb_enable_circle_background, true);

    mProgress = a.getInt(R.styleable.CircleProgressBar_mlpb_progress, 0);
    mMax = a.getInt(R.styleable.CircleProgressBar_mlpb_max, 100);
    int textVisible = a.getInt(R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1);
    if (textVisible != 1) {
        mIfDrawText = true;/*from w  ww .  ja v  a 2s  .  com*/
    }

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

From source file:com.google.samples.apps.iosched.util.LPreviewUtilsBase.java

public int getStatusBarColor() {
    // On pre-L devices, you can have any status bar color so long as it's black.
    return Color.BLACK;
}

From source file:com.infoprima.android.advtabcolor.SlidingTabsColorsFragment.java

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

    // BEGIN_INCLUDE (populate_tabs)
    /**//from  www .j  a  v a  2s .c o m
     * Populate our tab list with tabs. Each item contains a title, indicator color and divider
     * color, which are used by {@link SlidingTabLayout}.
     */
    mTabs.add(new SamplePagerItem(getString(R.string.tab_stream), // Title
            Color.BLUE, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_messages), // Title
            Color.RED, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_products), // Title
            Color.YELLOW, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_notifications), // Title
            Color.GREEN, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_getjson), // Title
            Color.BLACK, // Indicator color
            Color.GRAY // Divider color
    ));
    // END_INCLUDE (populate_tabs)
}

From source file:edu.stanford.mobisocial.dungbeetle.ImageGalleryActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    mCorralClient = CorralClient.getInstance(this);
    mFeedUri = getIntent().getData();/*from   w  w  w  .ja  v  a 2 s  . com*/
    long hash = getIntent().getLongExtra("objHash", -1);
    if (hash == -1) {
        toast("No image to view!");
        finish();
        return;
    }
    DbObj obj = App.instance().getMusubi().objForHash(hash);
    if (obj == null) {
        toast("Image does not exist!");
        finish();
        return;
    }
    mInitialObjId = obj.getLocalId();

    getSupportLoaderManager().initLoader(0, null, this);
    mGallery = new SlowGallery(this);
    mGallery.setBackgroundColor(Color.BLACK);
    addContentView(mGallery, CommonLayouts.FULL_SCREEN);
    if (savedInstanceState != null) {
        mInitialSelection = savedInstanceState.getInt("selection");
    }
}

From source file:cn.com.elex.social_life.support.view.cjj.CircleProgressBar.java

private void init(Context context, AttributeSet attrs, int defStyleAttr) {
    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar, defStyleAttr, 0);

    final float density = getContext().getResources().getDisplayMetrics().density;

    mBackGroundColor = a.getColor(R.styleable.CircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT);

    mProgressColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT);
    mColors = new int[] { mProgressColor };

    mInnerRadius = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_inner_radius, -1);

    mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_stoke_width,
            (int) (STROKE_WIDTH_LARGE * density));
    mArrowWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_width, -1);
    mArrowHeight = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_height, -1);
    mTextSize = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_text_size,
            (int) (DEFAULT_TEXT_SIZE * density));
    mTextColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_text_color, Color.BLACK);

    mShowArrow = a.getBoolean(R.styleable.CircleProgressBar_mlpb_show_arrow, false);
    mCircleBackgroundEnabled = a.getBoolean(R.styleable.CircleProgressBar_mlpb_enable_circle_background, true);

    mProgress = a.getInt(R.styleable.CircleProgressBar_mlpb_progress, 0);
    mMax = a.getInt(R.styleable.CircleProgressBar_mlpb_max, 100);
    int textVisible = a.getInt(R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1);
    if (textVisible != 1) {
        mIfDrawText = true;/*from   w w w  . j  a  v a  2  s  . c  o  m*/
    }

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

From source file:com.example.ysh.myapplication.view.readview.PageFactory.java

public PageFactory(Context context, int width, int height, int fontSize, String bookId,
        List<BookMixAToc.mixToc.Chapters> chaptersList) {
    mContext = context;// w ww  . j a v a 2  s.c o  m
    mWidth = width;
    mHeight = height;
    mFontSize = fontSize;
    mLineSpace = mFontSize / 5 * 2;
    mNumFontSize = ScreenUtils.dpToPxInt(16);
    marginWidth = ScreenUtils.dpToPxInt(15);
    marginHeight = ScreenUtils.dpToPxInt(15);
    mVisibleHeight = mHeight - marginHeight * 2 - mNumFontSize * 2 - mLineSpace * 2;
    mVisibleWidth = mWidth - marginWidth * 2;
    mPageLineCount = mVisibleHeight / (mFontSize + mLineSpace);
    rectF = new Rect(0, 0, mWidth, mHeight);

    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setTextSize(mFontSize);
    mPaint.setTextSize(ContextCompat.getColor(context, R.color.chapter_content_day));
    mPaint.setColor(Color.BLACK);
    mTitlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mTitlePaint.setTextSize(mNumFontSize);
    mTitlePaint.setColor(ContextCompat.getColor(AppUtils.getAppContext(), R.color.chapter_title_day));
    timeLen = (int) mTitlePaint.measureText("00:00");
    percentLen = (int) mTitlePaint.measureText("00.00%");
    // Typeface typeface = Typeface.createFromAsset(context.getAssets(),"fonts/FZBYSK.TTF");
    // mPaint.setTypeface(typeface);
    // mNumPaint.setTypeface(typeface);

    this.bookId = bookId;
    this.chaptersList = chaptersList;

    time = dateFormat.format(new Date());
}

From source file:com.example.abner.dynamicfragment.view.CustomSlidingTabLayout.java

public CustomSlidingTabLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    // Disable the Scroll Bar
    setHorizontalScrollBarEnabled(false);
    // Make sure that the Tab Strips fills this View
    setFillViewport(true);/*w  w w . j  a va2 s  .com*/

    TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.CustomSlidingTabLayout, 0, 0);

    setShouldExpand(ta.getBoolean(R.styleable.CustomSlidingTabLayout_shouldExpand, false));

    dTextColor = ta.getColor(R.styleable.CustomSlidingTabLayout_defaultTextColor, Color.BLACK);
    sTextColor = ta.getColor(R.styleable.CustomSlidingTabLayout_selectedTextColor, Color.RED);
    mTextSize = ta.getDimensionPixelOffset(R.styleable.CustomSlidingTabLayout_textSize, TAB_VIEW_TEXT_SIZE_SP);

    mNeedBold = ta.getBoolean(R.styleable.CustomSlidingTabLayout_needBold, false);

    mTitleOffset = (int) (TITLE_OFFSET_DIPS * getResources().getDisplayMetrics().density);

    mTabStrip = new CustomSlidingTabStrip(context);
    addView(mTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);

    // mTabStrip attrs
    int mBottomLineColor = ta.getColor(R.styleable.CustomSlidingTabLayout_BottomLineColor,
            getResources().getColor(R.color.grey_cccccc));
    int mIndicatorHeight = ta.getDimensionPixelOffset(R.styleable.CustomSlidingTabLayout_IndicatorHeight,
            DensityUtils.dip2px(getContext(), 6));
    int mBottomLineHeight = ta.getDimensionPixelOffset(R.styleable.CustomSlidingTabLayout_BottomLineHeight, 0);

    setBottomHeight(mBottomLineHeight);

    setIndicatorHeight(mIndicatorHeight);

    setBottomLineColor(mBottomLineColor);

    ta.recycle();

}