Example usage for android.graphics Color GRAY

List of usage examples for android.graphics Color GRAY

Introduction

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

Prototype

int GRAY

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

Click Source Link

Usage

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   ww  w  . jav 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.aero2.android.DefaultActivities.SmogMapActivity.java

public void showNoInternetScreen() {
    showLoadingScreen();/*from ww  w .  j av  a2  s.co  m*/
    ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar);
    progressBar.setVisibility(View.INVISIBLE);
    TextView noConnectionTV = (TextView) findViewById(R.id.loading_tv);
    noConnectionTV.setText("NO INTERNET CAN'T DOWNLOAD DATA FOR THE FIRST TIME :(");
    noConnectionTV.setTextColor(Color.GRAY);
    noConnectionTV.setPadding(40, 30, 40, 0);
}

From source file:net.phase.wallet.Currency.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    double exchrate = Currency.getRate(context.getActiveCurrency());

    LayoutInflater inflater = LayoutInflater.from(context);

    View v = inflater.inflate(R.layout.walletlayout, null);
    v.setLongClickable(true);// w  ww . jav a 2s  .  c  o  m
    v.setOnClickListener(context);
    v.setTag(position);

    DecimalFormat df = new DecimalFormat(WalletActivity.decimalString(decimalpoints));

    TextView balanceTextView = (TextView) v.findViewById(R.id.walletBalanceText);
    balanceTextView.setText(df.format(wallets[position].balance / BalanceRetriever.SATOSHIS_PER_BITCOIN));

    TextView curTextView = (TextView) v.findViewById(R.id.walletCurText);
    curTextView.setTextSize(10);

    if (exchrate != 0) {
        curTextView.setText(
                "(" + df.format(wallets[position].balance * exchrate / BalanceRetriever.SATOSHIS_PER_BITCOIN)
                        + context.getActiveCurrency() + ")");
    } else {
        curTextView.setText("");
    }

    balanceTextView.setTextSize(20);
    balanceTextView.setTextColor(Color.GREEN);

    TextView nameTextView = (TextView) v.findViewById(R.id.walletNameText);
    nameTextView.setText(wallets[position].name);
    nameTextView.setTextColor(Color.BLACK);
    nameTextView.setTextSize(16);

    TextView lastUpdatedTextView = (TextView) v.findViewById(R.id.lastUpdatedText);

    lastUpdatedTextView.setTextColor(Color.GRAY);
    lastUpdatedTextView.setTextSize(8);
    lastUpdatedTextView.setText("Last Updated: " + getTimeStampString(wallets[position].lastUpdated));

    TextView infoTextView = (TextView) v.findViewById(R.id.infoText);

    infoTextView.setTextColor(Color.GRAY);
    infoTextView.setTextSize(8);
    infoTextView.setText(
            wallets[position].keys.length + " keys (" + wallets[position].getActiveKeyCount() + " in use)");

    TextView txLastUpdatedTextView = (TextView) v.findViewById(R.id.txLastUpdatedText);
    txLastUpdatedTextView.setTextColor(Color.GRAY);
    txLastUpdatedTextView.setTextSize(8);

    TextView txInfoTextView = (TextView) v.findViewById(R.id.txInfoText);
    txInfoTextView.setTextColor(Color.GRAY);
    txInfoTextView.setTextSize(8);

    if (wallets[position].transactions != null && wallets[position].transactions.length > 0) {
        txLastUpdatedTextView.setText(
                "Last Transaction: " + getTimeStampString(Transaction.latest(wallets[position].transactions)));
        txInfoTextView.setText(wallets[position].transactions.length + " transactions ("
                + Transaction.compressTransactions(wallets[position].transactions).length + " unique)");
    } else {
        txLastUpdatedTextView.setText("");
        txInfoTextView.setText("");
    }

    Button button = (Button) v.findViewById(R.id.updateButton);
    button.setTag(position);
    button.setOnClickListener(context);
    return v;
}

From source file:com.money.manager.ex.home.HomeFragment.java

private void addFooterToExpandableListView(double curTotal, double curReconciled) {
    // manage footer list view
    if (linearFooter == null) {
        linearFooter = (LinearLayout) getActivity().getLayoutInflater().inflate(R.layout.item_account_bills,
                null);//from w  w  w. j  ava  2  s . co  m
        // text view into layout
        txtFooterSummary = (TextView) linearFooter.findViewById(R.id.textViewItemAccountTotal);
        txtFooterSummaryReconciled = (TextView) linearFooter
                .findViewById(R.id.textViewItemAccountTotalReconciled);
        if (mHideReconciled) {
            txtFooterSummaryReconciled.setVisibility(View.GONE);
        }
        // set text
        TextView txtTextSummary = (TextView) linearFooter.findViewById(R.id.textViewItemAccountName);
        txtTextSummary.setText(R.string.summary);
        // invisible image
        ImageView imgSummary = (ImageView) linearFooter.findViewById(R.id.imageViewAccountType);
        imgSummary.setVisibility(View.INVISIBLE);
        // set color textview
        txtTextSummary.setTextColor(Color.GRAY);
        txtFooterSummary.setTextColor(Color.GRAY);
        if (!mHideReconciled) {
            txtFooterSummaryReconciled.setTextColor(Color.GRAY);
        }
    }
    // remove footer
    mExpandableListView.removeFooterView(linearFooter);
    // set text
    txtTotalAccounts.setText(mCurrencyService.getBaseCurrencyFormatted(MoneyFactory.fromDouble(curTotal)));
    txtFooterSummary.setText(txtTotalAccounts.getText());
    if (!mHideReconciled) {
        txtFooterSummaryReconciled
                .setText(mCurrencyService.getBaseCurrencyFormatted(MoneyFactory.fromDouble(curReconciled)));
    }
    // add footer
    mExpandableListView.addFooterView(linearFooter, null, false);
}

From source file:com.aujur.ebookreader.Configuration.java

public int getTextColor() {
    return getProfileSetting(KEY_TEXT, Color.BLACK, Color.GRAY);
}

From source file:com.spoiledmilk.ibikecph.LeftMenu.java

protected int getHintDisabledTextColor() {
    return Color.GRAY;
}

From source file:eu.power_switch.gui.dialog.AddActionDialog.java

private void setPositiveButtonVisibility(boolean visibility) {
    if (dialog != null) {
        if (visibility) {
            ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(defaultTextColor);
            ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setClickable(true);
        } else {/*  www.  j a v a  2s .com*/
            ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.GRAY);
            ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setClickable(false);
        }
    }
}

From source file:biz.bokhorst.xprivacy.ActivityMain.java

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    int userId = Util.getUserId(Process.myUid());
    boolean mounted = Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());
    boolean updates = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingUpdates, false);

    menu.findItem(R.id.menu_export).setEnabled(mounted);
    menu.findItem(R.id.menu_import).setEnabled(mounted);

    menu.findItem(R.id.menu_submit).setEnabled(Util.hasValidFingerPrint(this));

    menu.findItem(R.id.menu_pro).setVisible(!Util.isProEnabled() && Util.hasProLicense(this) == null);

    menu.findItem(R.id.menu_dump).setVisible(Util.isDebuggable(this));

    menu.findItem(R.id.menu_update).setVisible(updates);
    menu.findItem(R.id.menu_update).setEnabled(mounted);

    // Update filter count

    // Get settings
    boolean fUsed = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFUsed, false);
    boolean fInternet = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFInternet, false);
    boolean fRestriction = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFRestriction, false);
    boolean fPermission = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFPermission, true);
    boolean fOnDemand = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFOnDemand, false);
    boolean fUser = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFUser, true);
    boolean fSystem = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFSystem, false);

    // Count number of active filters
    int numberOfFilters = 0;
    if (fUsed)/*from  w ww  .j  a  v  a2 s.  c  o  m*/
        numberOfFilters++;
    if (fInternet)
        numberOfFilters++;
    if (fRestriction)
        numberOfFilters++;
    if (fPermission)
        numberOfFilters++;
    if (fOnDemand)
        numberOfFilters++;
    if (fUser)
        numberOfFilters++;
    if (fSystem)
        numberOfFilters++;

    if (numberOfFilters > 0) {
        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon_filter)
                .copy(Bitmap.Config.ARGB_8888, true);

        Paint paint = new Paint();
        paint.setStyle(Style.FILL);
        paint.setColor(Color.GRAY);
        paint.setTextSize(bitmap.getWidth() / 3);
        paint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));

        String text = Integer.toString(numberOfFilters);

        Canvas canvas = new Canvas(bitmap);
        canvas.drawText(text, bitmap.getWidth() - paint.measureText(text), bitmap.getHeight(), paint);

        MenuItem fMenu = menu.findItem(R.id.menu_filter);
        fMenu.setIcon(new BitmapDrawable(getResources(), bitmap));
    }

    return super.onPrepareOptionsMenu(menu);
}

From source file:edu.princeton.jrpalmer.asmlibrary.Settings.java

private void showSpinner(boolean _show, boolean store) {
    mIntervalSpinner.setEnabled(_show);/*  w ww  . j a va  2  s. c  o m*/
    if (_show) {
        mServiceMessage.setText(R.string.service_is_on);
        mIntervalSpinner.setVisibility(View.VISIBLE);
        mIntervalHeading.setTextColor(Color.WHITE);
        mIntervalText.setTextColor(oldColors);

    } else {
        mServiceMessage.setText(R.string.service_is_off);
        mIntervalSpinner.setVisibility(View.INVISIBLE);
        mIntervalHeading.setTextColor(Color.GRAY);
        mIntervalText.setTextColor(Color.GRAY);

    }
}

From source file:com.cw.litenote.note.Note_adapter.java

private String getHtmlStringWithViewPort(int position, int viewPort) {
    int mStyle = Note.mStyle;

    System.out.println("Note_adapter / _getHtmlStringWithViewPort");
    String strTitle = db_page.getNoteTitle(position, true);
    String strBody = db_page.getNoteBody(position, true);
    String linkUri = db_page.getNoteLinkUri(position, true);

    // replace note title
    //TitleBody,YouTube linkWeb linkTitlelinktitle,Gray?
    boolean bSetGray = false;
    if (Util.isEmptyString(strTitle) && Util.isEmptyString(strBody)) {
        if (Util.isYouTubeLink(linkUri)) {
            strTitle = Util.getYouTubeTitle(linkUri);
            bSetGray = true;//from w w w.ja v  a2 s  . co  m
        } else if (linkUri.startsWith("http")) {
            strTitle = mWebTitle;
            bSetGray = true;
        }
    }

    Long createTime = db_page.getNoteCreatedTime(position, true);
    String head = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + "<html><head>"
            + "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />";

    if (viewPort == VIEW_PORT_BY_NONE) {
        head = head + "<head>";
    } else if (viewPort == VIEW_PORT_BY_DEVICE_WIDTH) {
        head = head + "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" + "<head>";
    } else if (viewPort == VIEW_PORT_BY_SCREEN_WIDTH) {
        //           int screen_width = UtilImage.getScreenWidth(act);
        int screen_width = 640;
        head = head + "<meta name=\"viewport\" content=\"width=" + String.valueOf(screen_width)
                + ", initial-scale=1\">" + "<head>";
    }

    String separatedLineTitle = (!Util.isEmptyString(strTitle)) ? "<hr size=2 color=blue width=99% >" : "";
    String separatedLineBody = (!Util.isEmptyString(strBody)) ? "<hr size=1 color=black width=99% >" : "";

    // title
    if (!Util.isEmptyString(strTitle)) {
        Spannable spanTitle = new SpannableString(strTitle);
        Linkify.addLinks(spanTitle, Linkify.ALL);
        spanTitle.setSpan(new AlignmentSpan.Standard(Alignment.ALIGN_CENTER), 0, spanTitle.length(),
                Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

        //ref http://stackoverflow.com/questions/3282940/set-color-of-textview-span-in-android
        if (bSetGray) {
            ForegroundColorSpan foregroundSpan = new ForegroundColorSpan(Color.GRAY);
            spanTitle.setSpan(foregroundSpan, 0, spanTitle.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        }

        strTitle = Html.toHtml(spanTitle);
    } else
        strTitle = "";

    // body
    if (!Util.isEmptyString(strBody)) {
        Spannable spanBody = new SpannableString(strBody);
        Linkify.addLinks(spanBody, Linkify.ALL);
        strBody = Html.toHtml(spanBody);
    } else
        strBody = "";

    // set web view text color
    String colorStr = Integer.toHexString(ColorSet.mText_ColorArray[mStyle]);
    colorStr = colorStr.substring(2);

    String bgColorStr = Integer.toHexString(ColorSet.mBG_ColorArray[mStyle]);
    bgColorStr = bgColorStr.substring(2);

    return head + "<body color=\"" + bgColorStr + "\">" + "<br>" + //Note: text mode needs this, otherwise title is overlaid
            "<p align=\"center\"><b>" + "<font color=\"" + colorStr + "\">" + strTitle + "</font>" + "</b></p>"
            + separatedLineTitle + "<p>" + "<font color=\"" + colorStr + "\">" + strBody + "</font>" + "</p>"
            + separatedLineBody + "<p align=\"right\">" + "<font color=\"" + colorStr + "\">"
            + Util.getTimeString(createTime) + "</font>" + "</p>" + "</body></html>";
}