Example usage for android.graphics Color WHITE

List of usage examples for android.graphics Color WHITE

Introduction

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

Prototype

int WHITE

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

Click Source Link

Usage

From source file:com.acrr.acdisplay.ui.components.MediaWidget.java

@Override
public void onMetadataChanged(@NonNull Metadata metadata) {
    populateMetadata();/*from w w  w  . j  a  v  a 2s.  c  om*/
    final Bitmap bitmap = metadata.bitmap;

    // Check if artwork are equals. If so, then we don't need to
    // generate everything from the beginning.
    if (mArtwork == bitmap || mArtwork != null && mArtwork.sameAs(bitmap)) {
        return;
    }

    mArtwork = bitmap;
    mArtworkBackground = null;

    com.acrr.base.async.AsyncTask.stop(mPaletteWorker);
    com.acrr.base.async.AsyncTask.stop(mBackgroundWorker);
    updatePlayPauseButtonColor(Color.WHITE); // Reset color
    updateSeekBarColor(Color.WHITE); // Reset color

    if (bitmap != null) {
        // TODO: Load the vibrant color only.
        mArtworkColor = Color.WHITE;
        mPaletteWorker = new Palette.Builder(bitmap).maximumColorCount(16).generate(mPaletteCallback);

        int dynamicBgMode = getConfig().getDynamicBackgroundMode();
        if (Operator.bitAnd(dynamicBgMode, getBackgroundMask())) {
            mBackgroundWorker = BackgroundFactory.generateAsync(bitmap, mBackgroundCallback);
            return; // Do not reset the background.
        }
    } else {
        mPaletteWorker = null;
    }

    mBackgroundWorker = null;
    populateBackground();
}

From source file:com.spoiledmilk.cykelsuperstier.navigation.SMRouteNavigationActivity.java

public void onServiceContainerClick(View v) {
    v.setBackgroundColor(isServiceSelected ? Color.rgb(255, 255, 255) : Color.rgb(236, 104, 0));
    ((ImageView) findViewById(R.id.imgCheckbox2))
            .setImageResource(isServiceSelected ? R.drawable.check_field : R.drawable.check_in_orange);
    ((ImageView) findViewById(R.id.imgService)).setImageResource(
            isServiceSelected ? R.drawable.service_pump_icon_gray : R.drawable.service_pump_icon_white);
    textService.setTextColor(isServiceSelected ? getResources().getColor(R.color.DarkGrey) : Color.WHITE);
    if (isServiceSelected)
        getMapFragment().overlaysManager.removeServiceStations();
    else/* ww  w  .ja  v a  2  s  .c o m*/
        getMapFragment().overlaysManager.drawServiceStations(this);
    isServiceSelected = !isServiceSelected;
}

From source file:com.achep.acdisplay.ui.components.MediaWidget.java

@Override
public void onMetadataChanged(@NonNull Metadata metadata) {
    populateMetadata();/*from w  ww .j a v a 2 s .c  o m*/
    final Bitmap bitmap = metadata.bitmap;

    // Check if artwork are equals. If so, then we don't need to
    // generate everything from the beginning.
    if (mArtwork == bitmap || mArtwork != null && mArtwork.sameAs(bitmap)) {
        return;
    }

    mArtwork = bitmap;
    mArtworkBackground = null;

    com.achep.base.async.AsyncTask.stop(mPaletteWorker);
    com.achep.base.async.AsyncTask.stop(mBackgroundWorker);
    updatePlayPauseButtonColor(Color.WHITE); // Reset color
    updateSeekBarColor(Color.WHITE); // Reset color

    if (bitmap != null) {
        // TODO: Load the vibrant color only.
        mArtworkColor = Color.WHITE;
        mPaletteWorker = new Palette.Builder(bitmap).maximumColorCount(16).generate(mPaletteCallback);

        int dynamicBgMode = getConfig().getDynamicBackgroundMode();
        if (Operator.bitAnd(dynamicBgMode, getBackgroundMask())) {
            mBackgroundWorker = BackgroundFactory.generateAsync(bitmap, mBackgroundCallback);
            return; // Do not reset the background.
        }
    } else {
        mPaletteWorker = null;
    }

    mBackgroundWorker = null;
    populateBackground();
}

From source file:com.android.deskclock.alarms.dataadapter.ExpandedAlarmViewHolder.java

private void bindDaysOfWeekButtons(Alarm alarm) {
    HashSet<Integer> setDays = alarm.daysOfWeek.getSetDays();
    for (int i = 0; i < DaysOfWeek.DAYS_IN_A_WEEK; i++) {
        final CompoundButton dayButton = dayButtons[i];
        if (setDays.contains(mDayOrder[i])) {
            dayButton.setChecked(true);/* w  w w .  java  2s. co m*/
            dayButton.setTextColor(UiDataModel.getUiDataModel().getWindowBackgroundColor());
        } else {
            dayButton.setChecked(false);
            dayButton.setTextColor(Color.WHITE);
        }
    }
    if (alarm.daysOfWeek.isRepeating()) {
        repeat.setChecked(true);
        repeatDays.setVisibility(View.VISIBLE);
    } else {
        repeat.setChecked(false);
        repeatDays.setVisibility(View.GONE);
    }
}

From source file:com.progym.custom.fragments.CalloriesProgressMonthlyLineFragment.java

public void setLineData3(final Date date, final boolean isLeftIn) {

    final ProgressDialog ringProgressDialog = ProgressDialog.show(getActivity(),
            getResources().getString(R.string.please_wait), getResources().getString(R.string.populating_data),
            true);/*  w w w .jav a 2 s .  c o  m*/
    ringProgressDialog.setCancelable(true);
    new Thread(new Runnable() {

        @Override
        public void run() {
            try {

                int yMaxAxisValue = 0;
                try {

                    getActivity().runOnUiThread(new Runnable() {

                        @Override
                        public void run() {
                            rlRootGraphLayout.removeView(mChartView);
                        }
                    });

                } catch (Exception edsx) {
                    edsx.printStackTrace();
                }
                date.setDate(1);
                DATE = date;
                // Get amount of days in a month to find out average
                int daysInMonth = Utils.getDaysInMonth(date.getMonth(),
                        Integer.valueOf(Utils.formatDate(date, DataBaseUtils.DATE_PATTERN_YYYY)));
                // set First day of the month as first month

                int[] x = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
                        23, 24, 25, 26, 27, 28, 29, 30, 31 };

                // Creating an XYSeries for Consumed water
                XYSeries callories = new XYSeries("Callories");

                List<Ingridient> list;
                Date dt = date; // **
                // Adding data to Income and Expense Series
                for (int i = 1; i <= daysInMonth; i++) {
                    // get all water records consumed per this month
                    list = DataBaseUtils.getAllFoodConsumedInMonth(
                            Utils.formatDate(dt, DataBaseUtils.DATE_PATTERN_YYYY_MM_DD));
                    // init "average" data
                    int totalCallories = 0;
                    for (Ingridient ingridient : list) {
                        totalCallories += ingridient.kkal;
                    }
                    callories.add(i, totalCallories);
                    dt = DateUtils.addDays(dt, 1);
                    yMaxAxisValue = Math.max(yMaxAxisValue, totalCallories);
                }

                // Creating a dataset to hold each series
                final XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
                // Adding Income Series to the dataset
                dataset.addSeries(callories);

                // Creating XYSeriesRenderer to customize protein series
                XYSeriesRenderer calloriesRenderer = new XYSeriesRenderer();
                calloriesRenderer.setColor(Color.rgb(220, 255, 110));
                calloriesRenderer.setFillPoints(true);
                calloriesRenderer.setLineWidth(3);
                calloriesRenderer.setDisplayChartValues(true);

                // Creating a XYMultipleSeriesRenderer to customize the whole chart
                final XYMultipleSeriesRenderer multiRenderer = new XYMultipleSeriesRenderer();
                // multiRenderer.setXLabels(0);

                for (int i = 0; i < x.length; i++) {
                    multiRenderer.addXTextLabel(i, String.valueOf(x[i]));
                }

                // Adding incomeRenderer and expenseRenderer to multipleRenderer
                // Note: The order of adding dataseries to dataset and renderers to multipleRenderer
                // should be same
                multiRenderer.setChartTitle(String.format("Callories statistic"));
                multiRenderer.setXTitle(Utils.getSpecificDateValue(DATE, "MMM") + " of "
                        + Utils.formatDate(DATE, DataBaseUtils.DATE_PATTERN_YYYY));
                multiRenderer.setYTitle(getActivity().getResources().getString(R.string.callories_consumption));
                multiRenderer.setAxesColor(Color.WHITE);
                multiRenderer.setShowLegend(true);
                multiRenderer.addSeriesRenderer(calloriesRenderer);
                multiRenderer.setShowGrid(true);
                multiRenderer.setClickEnabled(true);
                multiRenderer.setXLabelsAngle(20);
                multiRenderer.setYAxisMax(yMaxAxisValue + 200);
                multiRenderer.setXLabelsColor(Color.WHITE);
                multiRenderer.setZoomButtonsVisible(false);
                // configure visible area
                multiRenderer.setXAxisMax(31);
                multiRenderer.setXAxisMin(1);
                multiRenderer.setAxisTitleTextSize(15);
                multiRenderer.setZoomEnabled(true);

                getActivity().runOnUiThread(new Runnable() {

                    @Override
                    public void run() {
                        mChartView = ChartFactory.getLineChartView(getActivity(), dataset, multiRenderer);
                        rlRootGraphLayout.addView(mChartView, 0);
                        if (isLeftIn) {
                            rightIn.setDuration(1000);
                            mChartView.startAnimation(rightIn);
                        } else {
                            leftIn.setDuration(1000);
                            mChartView.startAnimation(leftIn);
                        }
                    }
                });

            } catch (Exception e) {
                e.printStackTrace();
            }
            ringProgressDialog.dismiss();
        }
    }).start();

}

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

private void rebuildGlyphData() {
    SvgPathParser parser = new SvgPathParser() {
        @Override//from www.ja v  a 2s .  co  m
        protected float transformX(float x) {
            return x * mWidth / mViewport.x;
        }

        @Override
        protected float transformY(float y) {
            return y * mHeight / mViewport.y;
        }
    };

    Log.i(TAG, "---mWidth = " + mWidth + "---mViewport.x = " + mViewport.x);
    Log.i(TAG, "mGlyphStrings.length = " + mGlyphStrings.length);
    mGlyphData = new GlyphData[mGlyphStrings.length];
    for (int i = 0; i < mGlyphStrings.length; i++) {
        mGlyphData[i] = new GlyphData();
        try {
            mGlyphData[i].path = parser.parsePath(mGlyphStrings[i]);
        } catch (ParseException e) {
            mGlyphData[i].path = new Path();
            Log.e(TAG, "Couldn't parse path", e);
        }
        PathMeasure pm = new PathMeasure(mGlyphData[i].path, true);
        while (true) {
            mGlyphData[i].length = Math.max(mGlyphData[i].length, pm.getLength());
            if (!pm.nextContour()) {
                break;
            }
        }
        mGlyphData[i].paint = new Paint();
        mGlyphData[i].paint.setStyle(Paint.Style.STROKE);
        mGlyphData[i].paint.setAntiAlias(true);
        mGlyphData[i].paint.setColor(Color.WHITE);
        mGlyphData[i].paint.setStrokeWidth(
                TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, getResources().getDisplayMetrics()));
    }
}

From source file:com.acious.android.paginationseekbar.PaginationSeekBar.java

public PaginationSeekBar(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    setFocusable(true);// w  w  w. java  2 s .  c  om
    setWillNotDraw(false);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    float density = context.getResources().getDisplayMetrics().density;
    mTrackHeight = (int) (1 * density);
    mScrubberHeight = (int) (4 * density);
    int thumbSize = (int) (density * ThumbDrawable.DEFAULT_SIZE_DP);

    //Extra pixels for a touch area of 48dp
    int touchBounds = (int) (density * 32);
    mAddedTouchBounds = (touchBounds - thumbSize) / 2;

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PaginationSeekBar,
            R.attr.paginationSeekBarStyle, defStyle);

    int max = 100;
    int min = 0;
    int value = 1;
    mMirrorForRtl = a.getBoolean(R.styleable.PaginationSeekBar_psb_mirrorForRtl, mMirrorForRtl);
    mAllowTrackClick = a.getBoolean(R.styleable.PaginationSeekBar_psb_allowTrackClickToDrag, mAllowTrackClick);

    int indexMax = R.styleable.PaginationSeekBar_psb_max;
    int indexMin = R.styleable.PaginationSeekBar_psb_min;
    int indexValue = R.styleable.PaginationSeekBar_psb_value;
    pageCountPerOneBoard = R.styleable.PaginationSeekBar_psb_pageCountPerOneBoard;
    final TypedValue out = new TypedValue();
    //Not sure why, but we wanted to be able to use dimensions here...
    if (a.getValue(indexMax, out)) {
        if (out.type == TypedValue.TYPE_DIMENSION) {
            max = a.getDimensionPixelSize(indexMax, max);
        } else {
            max = a.getInteger(indexMax, max);
        }
    }
    if (a.getValue(indexMin, out)) {
        if (out.type == TypedValue.TYPE_DIMENSION) {
            min = a.getDimensionPixelSize(indexMin, min);
        } else {
            min = a.getInteger(indexMin, min);
        }
    }
    if (a.getValue(indexValue, out)) {
        if (out.type == TypedValue.TYPE_DIMENSION) {
            value = a.getDimensionPixelSize(indexValue, value);
        } else {
            value = a.getInteger(indexValue, value);
        }
    }
    if (a.getValue(pageCountPerOneBoard, out)) {
        pageCountPerOneBoard = a.getInteger(pageCountPerOneBoard, pageCountPerOneBoard);
    }
    mMin = min;
    mMax = Math.max(min + 1, max);
    mValue = Math.max(min, Math.min(max, value));
    updateKeyboardRange();

    mPrevPageText = a.getString(R.styleable.PaginationSeekBar_psb_indicatorPrevPageText);
    mNextPageText = a.getString(R.styleable.PaginationSeekBar_psb_indicatorNextPageText);
    mIndicatorFormatter = a.getString(R.styleable.PaginationSeekBar_psb_indicatorFormatter);

    ColorStateList trackColor = a.getColorStateList(R.styleable.PaginationSeekBar_psb_trackColor);
    ColorStateList progressColor = a.getColorStateList(R.styleable.PaginationSeekBar_psb_progressColor);
    ColorStateList rippleColor = a.getColorStateList(R.styleable.PaginationSeekBar_psb_rippleColor);
    int thumbTextColor = a.getColor(R.styleable.PaginationSeekBar_psb_thumbTextColor, Color.WHITE);
    boolean editMode = isInEditMode();
    if (editMode && rippleColor == null) {
        rippleColor = new ColorStateList(new int[][] { new int[] {} }, new int[] { Color.DKGRAY });
    }
    if (editMode && trackColor == null) {
        trackColor = new ColorStateList(new int[][] { new int[] {} }, new int[] { Color.GRAY });
    }
    if (editMode && progressColor == null) {
        progressColor = new ColorStateList(new int[][] { new int[] {} }, new int[] { 0xff009688 });
    }
    if (editMode && thumbTextColor == 0) {
        thumbTextColor = Color.WHITE;
    }
    mRipple = SeekBarCompat.getRipple(rippleColor);
    if (isLollipopOrGreater) {
        SeekBarCompat.setBackground(this, mRipple);
    } else {
        mRipple.setCallback(this);
    }

    TrackRectDrawable shapeDrawable = new TrackRectDrawable(trackColor);
    mTrack = shapeDrawable;
    mTrack.setCallback(this);

    shapeDrawable = new TrackRectDrawable(progressColor);
    mScrubber = shapeDrawable;
    mScrubber.setCallback(this);

    ThumbDrawable thumbDrawable = new ThumbDrawable(progressColor, thumbTextColor, thumbSize, mValue);
    mThumb = thumbDrawable;
    mThumb.setCallback(this);
    mThumb.setBounds(0, 0, mThumb.getIntrinsicWidth(), mThumb.getIntrinsicHeight());

    if (!editMode) {
        mIndicator = new PopupIndicator(context, attrs, defStyle, convertValueToMessage(mMax), mPrevPageText,
                mNextPageText);
        mIndicator.setListener(mFloaterListener);
    }
    a.recycle();

    setNumericTransformer(new DefaultNumericTransformer());

    initPagecountPerOneboard(pageCountPerOneBoard);

}

From source file:com.android.example.alwaysonstopwatch.StopwatchActivity.java

@Override
public void onEnterAmbient(Bundle ambientDetails) {
    Log.d(TAG, "ENTER Ambient");
    super.onEnterAmbient(ambientDetails);

    if (mRunning) {
        mActiveModeUpdateHandler.removeMessages(R.id.msg_update);
        mNotice.setVisibility(View.VISIBLE);
    }/*www .j a  va 2  s .c  o  m*/

    mActiveClockUpdateHandler.removeMessages(R.id.msg_update);

    mTimeView.setTextColor(Color.WHITE);
    Paint textPaint = mTimeView.getPaint();
    textPaint.setAntiAlias(false);
    textPaint.setStyle(Paint.Style.STROKE);
    textPaint.setStrokeWidth(2);

    mStartStopButton.setVisibility(View.INVISIBLE);
    mResetButton.setVisibility(View.INVISIBLE);
    mBackground.setBackgroundColor(Color.BLACK);

    mClockView.setTextColor(Color.WHITE);
    mClockView.getPaint().setAntiAlias(false);

    updateDisplayAndSetRefresh();
}

From source file:ch.hackzurich.migrozept.ScanditSDKSampleBarcodeActivity.java

/** 
 *  Called when a barcode has been decoded successfully.
 *  //from www  . j av  a  2s.  c o m
 *  @param barcode Scanned barcode content.
 *  @param symbology Scanned barcode symbology.
 */
public void didScanBarcode(String barcode, String symbology) {
    // Remove non-relevant characters that might be displayed as rectangles
    // on some devices. Be aware that you normally do not need to do this.
    // Only special GS1 code formats contain such characters.
    String cleanedBarcode = "";
    for (int i = 0; i < barcode.length(); i++) {
        if (barcode.charAt(i) > 30) {
            cleanedBarcode += barcode.charAt(i);
        }
    }

    Log.i("custom", "Send Barcode to API " + cleanedBarcode);

    String url = "http://hackzurich14.herokuapp.com/api/" + cleanedBarcode + "?recipes=1";
    try {
        new APIWorker(this).execute(new URL(url));
    } catch (Exception e) {
        //showAlert("Exception",e.toString());
        showToast("API Worker call Exception");
    }

    mButton = new Button(this);
    mButton.setTextColor(Color.WHITE);
    mButton.setTextSize(30);
    mButton.setGravity(Gravity.CENTER);
    mButton.setBackgroundColor(0xFF000000);
    mButton.setText("Scanned " + symbology + " code:\n\n" + cleanedBarcode + "\n");
    ((RelativeLayout) mBarcodePicker).addView(mButton, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    mBarcodePicker.pauseScanning();

    // TODO: go to recipe overview
    mButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            mBarcodePicker.resumeScanning();
            ((RelativeLayout) mBarcodePicker).removeView(mButton);
            mButton = null;
        }
    });
    mButton.requestFocus();

    // Example code that would typically be used in a real-world app using 
    // the Scandit SDK.
    /*
    // Access the image in which the bar code has been recognized.
    byte[] imageDataNV21Encoded = barcodePicker.getCameraPreviewImageOfFirstBarcodeRecognition();
    int imageWidth = barcodePicker.getCameraPreviewImageWidth();
    int imageHeight = barcodePicker.getCameraPreviewImageHeight();
            
    // Stop recognition to save resources.
    mBarcodePicker.stopScanning();
    */
}

From source file:com.do_an_httt.truon_000.jobssocialnetwork.view.SlidingTabLayout.java

private void populateTabStrip() {
    final PagerAdapter adapter = mViewPager.getAdapter();
    final OnClickListener tabClickListener = new TabClickListener();

    for (int i = 0; i < adapter.getCount(); i++) {
        View tabView = null;//from w  w  w  .  j a  v a 2  s  .co m
        TextView tabTitleView = null;

        if (mTabViewLayoutId != 0) {
            // If there is a custom tab view layout id set, try and inflate it
            tabView = LayoutInflater.from(getContext()).inflate(mTabViewLayoutId, mTabStrip, false);
            tabTitleView = (TextView) tabView.findViewById(mTabViewTextViewId);
        }

        if (tabView == null) {
            tabView = createDefaultTabView(getContext());
        }

        if (tabTitleView == null && TextView.class.isInstance(tabView)) {
            tabTitleView = (TextView) tabView;
        }
        tabTitleView.setTextColor(Color.WHITE);
        tabTitleView.setText(listStringTabs[i]);
        tabView.setOnClickListener(tabClickListener);

        mTabStrip.addView(tabView);
    }
}