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.mdlive.sav.MDLiveProviderDetails.java

public void handleDateResponse(JSONObject response) {
    horizontalscrollview.setVisibility(View.GONE);
    //Fetch Data From the Services
    JsonParser parser = new JsonParser();
    JsonObject responObj = (JsonObject) parser.parse(response.toString());
    JsonObject profileobj = responObj.get("doctor_profile").getAsJsonObject();

    JsonObject appointment_slot = profileobj.get("appointment_slot").getAsJsonObject();
    JsonArray available_hour = appointment_slot.get("available_hour").getAsJsonArray();

    LinearLayout layout = (LinearLayout) findViewById(R.id.panelMessageFiles);
    String str_timeslot = "", str_phys_avail_id = "";
    if (layout.getChildCount() > 0) {
        layout.removeAllViews();//from   ww  w  . j  a  va 2 s .c  o m
    }
    timeSlotListMap.clear();

    for (int i = 0; i < available_hour.size(); i++) {
        JsonObject availabilityStatus = available_hour.get(i).getAsJsonObject();
        String str_availabilityStatus = "";

        if (MdliveUtils.checkJSONResponseHasString(availabilityStatus, "status")) {
            str_availabilityStatus = availabilityStatus.get("status").getAsString();
            if (str_availabilityStatus.equals("Available")) {
                //This visibility is for future timeslots response for the corresponding date selection.
                //if  the future date has timeslots then make an appointment req layout nd textview visibility will be gone

                findViewById(R.id.noappmtsTxtLayout).setVisibility(View.GONE);
                reqfutureapptBtnLayout.setVisibility(View.GONE);
                JsonArray timeSlotArray = availabilityStatus.get("time_slot").getAsJsonArray();

                for (int j = 0; j < timeSlotArray.size(); j++) {
                    JsonObject timeSlotObj = timeSlotArray.get(j).getAsJsonObject();

                    if (MdliveUtils.checkJSONResponseHasString(timeSlotObj, "appointment_type")
                            && MdliveUtils.checkJSONResponseHasString(timeSlotObj, "timeslot")) {
                        str_appointmenttype = timeSlotObj.get("appointment_type").getAsString();
                        str_timeslot = timeSlotObj.get("timeslot").getAsString();
                        selectedTimestamp = timeSlotObj.get("timeslot").getAsString();

                        if (MdliveUtils.checkJSONResponseHasString(timeSlotObj, "phys_availability_id")) {
                            str_phys_avail_id = timeSlotObj.get("phys_availability_id").getAsString();
                        } else {
                            str_phys_avail_id = null;
                        }

                        HashMap<String, String> datemap = new HashMap<String, String>();
                        datemap.put("timeslot", str_timeslot);
                        datemap.put("phys_id", str_phys_avail_id);
                        datemap.put("appointment_type", str_appointmenttype);
                        videophoneparentLl.setVisibility(View.VISIBLE);
                        timeSlotListMap.add(datemap);

                        final Button myText = new Button(MDLiveProviderDetails.this);

                        if (str_timeslot.equals("0")) {
                            final int density = (int) getBaseContext().getResources()
                                    .getDisplayMetrics().density;

                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                myText.setElevation(0f);
                            }
                            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                                    LinearLayout.LayoutParams.WRAP_CONTENT,
                                    LinearLayout.LayoutParams.WRAP_CONTENT);
                            params.setMargins(4 * density, 4 * density, 4 * density, 4 * density);
                            myText.setLayoutParams(params);
                            myText.setGravity(Gravity.CENTER);
                            myText.setTextColor(Color.WHITE);
                            myText.setTextSize(16);
                            myText.setPadding(8 * density, 4 * density, 8 * density, 4 * density);
                            myText.setBackgroundResource(R.drawable.timeslot_white_rounded_corner);
                            myText.setText("Now");
                            myText.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner);
                            myText.setClickable(true);
                            previousSelectedTv = myText;
                            if (str_appointmenttype.toLowerCase().contains("video")
                                    || str_appointmenttype.toLowerCase().contains("video or phone")) {
                                videoList.add(myText);
                            }
                            if (str_appointmenttype.toLowerCase().contains("phone")) {
                                phoneList.add(myText);
                            }

                            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
                                    LinearLayout.LayoutParams.WRAP_CONTENT,
                                    LinearLayout.LayoutParams.WRAP_CONTENT);
                            lp.setMargins(4 * density, 4 * density, 4 * density, 4 * density);
                            myText.setLayoutParams(lp);
                            myText.setTag("Now");
                            defaultNowTextPreferences(myText, str_appointmenttype);
                            selectedTimeslot = true;
                            clickEventForHorizontalText(myText, str_timeslot, str_phys_avail_id);
                            layout.addView(myText);
                        } else {
                            setHorizontalScrollviewTimeslots(layout, str_timeslot, j, str_phys_avail_id);
                        }
                    }
                }
            } else {
                if (layout.getChildCount() == 0) {
                    selectedTimeslot = false;
                    findViewById(R.id.noappmtsTxtLayout).setVisibility(View.VISIBLE);
                    ((TextView) findViewById(R.id.noAppmtsTxt))
                            .setText(getString(R.string.mdl_notimeslots_txt));
                    reqfutureapptBtnLayout.setVisibility(viewsVisibility);
                    ((TextView) findViewById(R.id.reqfutureapptBtn)).setText("Make an appointment request");
                    ((TextView) findViewById(R.id.reqfutureapptBtn)).setTextColor(Color.parseColor("#0079FD"));
                    videophoneparentLl.setVisibility(View.GONE);
                    tapReqFutureBtnAction();
                    findViewById(R.id.reqApmtBtm).setVisibility(View.GONE);
                }
            }
        }
    }

}

From source file:com.amaze.carbonfilemanager.fragments.ProcessViewer.java

/**
 * Creates an instance for {@link LineDataSet} which will store the entries
 * @return/*from   w w  w  .  ja va 2s.  co  m*/
 */
private LineDataSet createDataSet() {
    LineDataSet lineDataset = new LineDataSet(new ArrayList<Entry>(), null);

    lineDataset.setLineWidth(1.75f);
    lineDataset.setCircleRadius(5f);
    lineDataset.setCircleHoleRadius(2.5f);
    lineDataset.setColor(Color.WHITE);
    lineDataset.setCircleColor(Color.WHITE);
    lineDataset.setHighLightColor(Color.WHITE);
    lineDataset.setDrawValues(false);
    lineDataset.setCircleColorHole(accentColor);

    return lineDataset;
}

From source file:com.ryan.ryanreader.reddit.prepared.RedditPreparedPost.java

private void rebuildSubtitle(Context context) {

    // TODO customise display
    // TODO preference for the X days, X hours thing

    final TypedArray appearance = context.obtainStyledAttributes(new int[] { R.attr.rrPostSubtitleBoldCol,
            R.attr.rrPostSubtitleUpvoteCol, R.attr.rrPostSubtitleDownvoteCol });

    final int boldCol = appearance.getColor(0, 255), rrPostSubtitleUpvoteCol = appearance.getColor(1, 255),
            rrPostSubtitleDownvoteCol = appearance.getColor(2, 255);

    final BetterSSB postListDescSb = new BetterSSB();

    final int pointsCol;
    int score = src.score;

    if (Boolean.TRUE.equals(src.likes))
        score--;//w w  w  .  java  2s  . co m
    if (Boolean.FALSE.equals(src.likes))
        score++;

    if (isUpvoted()) {
        pointsCol = rrPostSubtitleUpvoteCol;
        score++;
    } else if (isDownvoted()) {
        pointsCol = rrPostSubtitleDownvoteCol;
        score--;
    } else {
        pointsCol = boldCol;
    }

    if (src.over_18) {
        postListDescSb.append(" NSFW ",
                BetterSSB.BOLD | BetterSSB.FOREGROUND_COLOR | BetterSSB.BACKGROUND_COLOR, Color.WHITE,
                Color.RED, 1f); // TODO color?
        postListDescSb.append("  ", 0);
    }

    postListDescSb.append(String.valueOf(score), BetterSSB.BOLD | BetterSSB.FOREGROUND_COLOR, pointsCol, 0, 1f);
    postListDescSb.append(" " + context.getString(R.string.subtitle_points) + " ", 0);
    postListDescSb.append(
            RRTime.formatDurationMsAgo(context, RRTime.utcCurrentTimeMillis() - src.created_utc * 1000),
            BetterSSB.BOLD | BetterSSB.FOREGROUND_COLOR, boldCol, 0, 1f);
    postListDescSb.append(" " + context.getString(R.string.subtitle_by) + " ", 0);
    postListDescSb.append(src.author, BetterSSB.BOLD | BetterSSB.FOREGROUND_COLOR, boldCol, 0, 1f);

    if (showSubreddit) {
        postListDescSb.append(" " + context.getString(R.string.subtitle_to) + " ", 0);
        postListDescSb.append(src.subreddit, BetterSSB.BOLD | BetterSSB.FOREGROUND_COLOR, boldCol, 0, 1f);
    }

    postListDescSb.append(" (" + src.domain + ")", 0);

    postListDescription = postListDescSb.get();
}

From source file:au.com.wallaceit.reddinator.Rservice.java

private void getThemeColors() {
    switch (Integer.valueOf(mSharedPreferences.getString("widgetthemepref", "1"))) {
    // set colors array: healine text, load more text, divider, domain text, vote & comments
    case 1:/*from   ww  w  .  java 2  s .c o  m*/
        themeColors = new int[] { Color.BLACK, Color.BLACK, Color.parseColor("#D7D7D7"),
                Color.parseColor("#336699"), Color.parseColor("#FF4500") };
        break;
    case 2:
        themeColors = new int[] { Color.WHITE, Color.WHITE, Color.parseColor("#646464"),
                Color.parseColor("#5F99CF"), Color.parseColor("#FF8B60") };
        break;
    case 3:
    case 4:
    case 5:
        themeColors = new int[] { Color.WHITE, Color.WHITE, Color.parseColor("#646464"),
                Color.parseColor("#CEE3F8"), Color.parseColor("#FF8B60") };
        break;
    }
    // user title color override
    if (!mSharedPreferences.getString("titlecolorpref", "0").equals("0")) {
        themeColors[0] = Color.parseColor(mSharedPreferences.getString("titlecolorpref", "#000"));
    }
}

From source file:com.android.deskclock.alarms.AlarmActivity.java

private ValueAnimator getButtonAnimator(ImageView button, int tintColor) {
    return ObjectAnimator.ofPropertyValuesHolder(button,
            PropertyValuesHolder.ofFloat(View.SCALE_X, BUTTON_SCALE_DEFAULT, 1.0f),
            PropertyValuesHolder.ofFloat(View.SCALE_Y, BUTTON_SCALE_DEFAULT, 1.0f),
            PropertyValuesHolder.ofInt(AnimatorUtils.BACKGROUND_ALPHA, 0, 255),
            PropertyValuesHolder.ofInt(AnimatorUtils.DRAWABLE_ALPHA, BUTTON_DRAWABLE_ALPHA_DEFAULT, 255),
            PropertyValuesHolder.ofObject(AnimatorUtils.DRAWABLE_TINT, AnimatorUtils.ARGB_EVALUATOR,
                    Color.WHITE, tintColor));
}

From source file:com.paic.zhifu.wallet.activity.modules.register.PhoneValidationActivity.java

/**
 * ?//from w ww .  ja v a2s.c  o m
 */
private void checkAndChangeNextBtnState() {
    // ?????????
    if (!checkPhoneNum() || !checkLicense() || !checkSMSCode()) {
        next.setBackgroundResource(R.drawable.normal_btn2);
        next.setTextColor(Color.BLACK);
        next.setEnabled(false);
    } else {
        next.setBackgroundResource(R.drawable.normal_btn);
        next.setTextColor(Color.WHITE);
        next.setEnabled(true);
    }
}

From source file:com.lepin.activity.MyOrderDetailActivity.java

protected void operateBook(final int type, String url) {
    // 1 ? 2 ? 4??
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("infoOrderId", this.book_id));
    if (type == COMPLETE_PAY_CASH_BOOK) {
        params.add(new BasicNameValuePair("payType", Constant.PAY_OFFLINE));// OFFLINE
        // ONLINE
    }//from  w  w  w .j  a  v  a 2 s.c o  m
    String loadingMsg = "";
    if (type == COMFIRM_IN) {
        loadingMsg = getString(R.string.comfirm_order_in);
    } else if (type == COMPLETE_PAY_CASH_BOOK) {
        loadingMsg = getString(R.string.complete_order_ing);
    } else if (type == GET_ORDER_MSG) {
        loadingMsg = getString(R.string.order_detail_loading);
    } else if (type == CANCEL_ORDER) {
        loadingMsg = getString(R.string.order_cancel_ing);
    }

    util.doPostRequest(MyOrderDetailActivity.this, new OnHttpRequestDataCallback() {

        public void onSuccess(String result) {
            if (type == GET_ORDER_MSG) {// ???
                setViewValueAndBtnState(result);
            } else {
                JsonResult<String> jsonResult = util.getObjFromJsonResult(result,
                        new TypeToken<JsonResult<String>>() {
                        });
                final boolean isSuccess = jsonResult.isSuccess();
                if (type == COMFIRM_IN) {
                    if (isSuccess) {// ?  ?
                        Util.showLongToast(MyOrderDetailActivity.this, jsonResult.getData());
                        mCancelAndOkLayout.setVisibility(View.GONE);
                        mCancelLayout.setVisibility(View.VISIBLE);
                        setBtnTextAndColor(R.string.order_state_complete, Color.GRAY, false, View.VISIBLE);
                    } else {
                        mCancelLayout.setVisibility(View.VISIBLE);
                        mCancleDriverBtn.setVisibility(View.VISIBLE);
                        Util.showLongToast(MyOrderDetailActivity.this, jsonResult.getData());
                    }
                } else if (type == COMPLETE_PAY_CASH_BOOK) {
                    if (isSuccess) {
                        mCancelAndOkLayout.setVisibility(View.GONE);
                        mCancleDriverBtn.setVisibility(View.VISIBLE);
                        mCancelLayout.setVisibility(View.VISIBLE);
                        setBtnTextAndColor(R.string.order_state_complete, Color.WHITE, false, View.VISIBLE);
                    }
                    Util.showLongToast(MyOrderDetailActivity.this, jsonResult.getData());
                } else if (type == CANCEL_ORDER) {
                    if (isSuccess) {// ???
                        Util.showLongToast(MyOrderDetailActivity.this, jsonResult.getData());
                        mCancelAndOkLayout.setVisibility(View.GONE);
                        mCancelLayout.setVisibility(View.VISIBLE);
                        setBtnTextAndColor(R.string.has_been_cancel, Color.WHITE, false, View.VISIBLE);
                    } else {// ??
                        Util.showLongToast(MyOrderDetailActivity.this, jsonResult.getData());
                    }
                }
            }
        }

        @Override
        public void onFail(String errorType, String errorMsg) {
            // TODO Auto-generated method stub
            super.onFail(errorType, errorMsg);
            Util.showToast(MyOrderDetailActivity.this, errorMsg);
        }
    }, params, url, loadingMsg, true);
}

From source file:com.androidinspain.deskclock.alarms.AlarmActivity.java

/**
 * Perform dismiss animation and send dismiss intent.
 *//*from  w w  w .  j  a v  a 2 s. c  o  m*/
private void dismiss() {
    mAlarmHandled = true;
    LOGGER.v("Dismissed: %s", mAlarmInstance);

    setAnimatedFractions(0.0f /* snoozeFraction */, 1.0f /* dismissFraction */);

    getAlertAnimator(mDismissButton, com.androidinspain.deskclock.R.string.alarm_alert_off_text,
            null /* infoText */,
            getString(com.androidinspain.deskclock.R.string.alarm_alert_off_text) /* accessibilityText */,
            Color.WHITE, mCurrentHourColor).start();

    AlarmStateManager.deleteInstanceAndUpdateParent(this, mAlarmInstance);

    Events.sendAlarmEvent(com.androidinspain.deskclock.R.string.action_dismiss,
            com.androidinspain.deskclock.R.string.label_deskclock);

    // Unbind here, otherwise alarm will keep ringing until activity finishes.
    unbindAlarmService();
}

From source file:com.hypodiabetic.happ.MainActivity.java

public void displayCurrentInfo() {
    final TextView currentBgValueText = (TextView) findViewById(R.id.currentBgValueRealTime);
    final TextView notificationText = (TextView) findViewById(R.id.notices);
    final TextView deltaText = (TextView) findViewById(R.id.bgDelta);
    if ((currentBgValueText.getPaintFlags() & Paint.STRIKE_THRU_TEXT_FLAG) > 0) {
        currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
    }//  w  w w  .  ja v  a  2 s  .c o m
    Bg lastBgreading = Bg.last();

    if (lastBgreading != null) {
        notificationText.setText(lastBgreading.readingAge());
        String bgDelta = tools.unitizedBG(lastBgreading.bgdelta, MainApp.instance().getApplicationContext());
        if (lastBgreading.bgdelta >= 0)
            bgDelta = "+" + bgDelta;
        deltaText.setText(bgDelta);
        currentBgValueText.setText(extendedGraphBuilder.unitized_string(lastBgreading.sgv_double()) + " "
                + lastBgreading.slopeArrow());

        if ((new Date().getTime()) - (60000 * 16) - lastBgreading.datetime > 0) {
            notificationText.setTextColor(Color.parseColor("#C30909"));
            currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
        } else {
            notificationText.setTextColor(Color.WHITE);
        }
        double estimate = lastBgreading.sgv_double();
        if (extendedGraphBuilder.unitized(estimate) <= extendedGraphBuilder.lowMark) {
            currentBgValueText.setTextColor(Color.parseColor("#C30909"));
        } else if (extendedGraphBuilder.unitized(estimate) >= extendedGraphBuilder.highMark) {
            currentBgValueText.setTextColor(Color.parseColor("#FFBB33"));
        } else {
            currentBgValueText.setTextColor(Color.WHITE);
        }
    }

    //Stats UI update
    updateStats(null);

    //OpenAPS UI update
    updateOpenAPSDetails(null);

    //Temp Basal running update
    updateRunningTemp();
}

From source file:com.amaze.filemanager.ui.views.drawer.Drawer.java

private void addNewItem(Menu menu, int group, int order, String text, MenuMetadata meta, @DrawableRes int icon,
        @DrawableRes Integer actionViewIcon) {
    if (BuildConfig.DEBUG && menu.findItem(order) != null)
        throw new IllegalStateException("Item already id exists: " + order);

    MenuItem item = menu.add(group, order, order, text).setIcon(icon);
    dataUtils.putDrawerMetadata(item, meta);

    if (actionViewIcon != null) {
        item.setActionView(R.layout.layout_draweractionview);

        ImageView imageView = item.getActionView().findViewById(R.id.imageButton);
        imageView.setImageResource(actionViewIcon);
        if (!mainActivity.getAppTheme().equals(AppTheme.LIGHT)) {
            imageView.setColorFilter(Color.WHITE);
        }//  ww  w.j  a va  2  s .c  o m

        item.getActionView().setOnClickListener((view) -> onNavigationItemActionClick(item));
    }
}