List of usage examples for android.graphics Color GRAY
int GRAY
To view the source code for android.graphics Color GRAY.
Click Source Link
From source file:com.mdlive.sav.MDLiveProviderDetails.java
private void onlyForIdaho() { byphoneBtnLayout.setVisibility(View.VISIBLE); byphoneBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border); byphoneBtn.setTextColor(getResources().getColor(R.color.disableBtn)); ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_gray); byphoneBtnLayout.setClickable(false); saveAppmtType("video"); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner); byvideoBtn.setTextColor(Color.GRAY); byvideoBtn.setTextColor(Color.GRAY); byvideoBtnLayout.setVisibility(View.VISIBLE); byvideoBtnLayout.setOnClickListener(new View.OnClickListener() { @Override/*from w w w. ja v a2 s . c om*/ public void onClick(View v) { try { horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner); byvideoBtn.setTextColor(Color.WHITE); ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white); ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_gray); byphoneBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border); byphoneBtn.setTextColor(getResources().getColor(R.color.disableBtn)); byphoneBtnLayout.setVisibility(View.VISIBLE); byphoneBtnLayout.setClickable(false); horizontalscrollview.setVisibility(View.VISIBLE); LinearLayout layout = (LinearLayout) findViewById(R.id.panelMessageFiles); if (layout.getChildCount() > 0) { layout.removeAllViews(); } for (TextView tv : videoList) { layout.addView(tv); } saveConsultationType("Video", MDLiveProviderDetails.this); //Enable Request Appointment Button horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0); ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white); selectedTimeslot = false; enableReqAppmtBtn(); clearTimeSlotViews(); horizontalscrollview.startAnimation( AnimationUtils.loadAnimation(MDLiveProviderDetails.this, R.anim.mdlive_trans_left_in)); } catch (Exception e) { e.printStackTrace(); } } }); }
From source file:com.hanbing.library.android.view.CustomTabLayout23.java
protected int getIndicatorLeft(View tabView, int position) { tabView.setBackgroundColor(Color.LTGRAY); ((ViewGroup) tabView).getChildAt(1).setBackgroundColor(Color.GRAY); return ((ViewGroup) tabView).getChildAt(1).getLeft() + tabView.getLeft(); }
From source file:com.mdlive.sav.MDLiveProviderDetails.java
private void setHorizontalScrollviewTimeslots(LinearLayout layout, String str_timeslot, int position, String physId) {/*from w w w . ja va 2s . c o m*/ final int density = (int) getBaseContext().getResources().getDisplayMetrics().density; final Button myText = new Button(MDLiveProviderDetails.this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { myText.setElevation(0f); } horizontalscrollview.setContentDescription("Horizontal ScrollView"); myText.setTextColor(Color.GRAY); myText.setTextSize(16); 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.setBackgroundResource(R.drawable.timeslot_white_rounded_corner); myText.setClickable(true); myText.setTag(timeSlotListMap.get(position).get("appointment_type")); myText.setPadding(8 * density, 4 * density, 8 * density, 4 * density); myText.setText(TimeZoneUtils.getTimeFromTimestamp(str_timeslot, this)); layout.addView(myText); if (str_appointmenttype.equalsIgnoreCase("video") || str_appointmenttype.equalsIgnoreCase("video or phone") && str_timeslot != null && !str_timeslot.equals("0")) { videoList.add(myText); } if (str_appointmenttype.equalsIgnoreCase("phone") || str_appointmenttype.equalsIgnoreCase("video or phone") && str_timeslot != null && !str_timeslot.equals("0")) { phoneList.add(myText); } clickForVideoOrPhoneTapReqFutureAction(); clickEventForHorizontalText(myText, str_timeslot, physId); }
From source file:com.mdlive.sav.MDLiveProviderDetails.java
private void defaultNowTextPreferences(final TextView timeslotTxt, final String appointmentType) { selectedTimeslot = true;/* w w w. j a v a 2s. co m*/ //saveConsultationType(appointmentType); saveProviderDetailsForConFirmAppmt(timeslotTxt.getText().toString(), ((TextView) findViewById(R.id.dateTxt)).getText().toString().trim(), str_ProfileImg, selectedTimestamp, str_phys_avail_id); //This is to select and Unselect the Timeslot if (previousSelectedTv == null) { previousSelectedTv = timeslotTxt; timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner); timeslotTxt.setTextColor(Color.WHITE); } else { previousSelectedTv.setBackgroundResource(R.drawable.timeslot_white_rounded_corner); previousSelectedTv.setTextColor(Color.GRAY); previousSelectedTv = timeslotTxt; timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner); timeslotTxt.setTextColor(Color.WHITE); } }
From source file:com.mdlive.sav.MDLiveProviderDetails.java
private void clickEventForHorizontalText(final Button timeslotTxt, final String Timestamp, final String phys_avail_id) { timeslotTxt.setOnClickListener(new View.OnClickListener() { @Override//from w ww . j a v a2s. com public void onClick(View v) { selectedTimeslot = true; saveProviderDetailsForConFirmAppmt(timeslotTxt.getText().toString(), ((TextView) findViewById(R.id.dateTxt)).getText().toString(), str_ProfileImg, Timestamp, phys_avail_id); //This is to select and Unselect the Timeslot if (previousSelectedTv == null) { previousSelectedTv = timeslotTxt; timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner); timeslotTxt.setTextColor(Color.WHITE); } else { previousSelectedTv.setBackgroundResource(R.drawable.timeslot_white_rounded_corner); previousSelectedTv.setTextColor(Color.GRAY); previousSelectedTv = timeslotTxt; timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner); timeslotTxt.setTextColor(Color.WHITE); } //Enabling or Disabling the Request Appointment Button. enableReqAppmtBtn(); } }); }
From source file:com.mdlive.sav.MDLiveProviderDetails.java
private void visibilityBasedOnHorizontalTextView(String position) { if (position.equalsIgnoreCase("video")) { saveConsultationType("Video", this); reqfutureapptBtnLayout.setVisibility(View.GONE); byvideoBtnLayout.setVisibility(View.VISIBLE); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner); byvideoBtn.setTextColor(Color.WHITE); byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner); byphoneBtn.setTextColor(Color.GRAY); byvideoBtnLayout.setOnClickListener(new View.OnClickListener() { @Override/*from www .j a va 2s .co m*/ public void onClick(View v) { byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner); byvideoBtn.setTextColor(Color.WHITE); byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner); byphoneBtn.setTextColor(Color.GRAY); if (layout.getChildCount() > 0) layout.removeAllViews(); } }); byphoneBtnLayout.setVisibility(View.VISIBLE); byphoneBtnLayout.setClickable(false); } else if (position.equalsIgnoreCase("video or phone")) { byvideoBtnLayout.setVisibility(View.VISIBLE); byvideoBtnLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner); byvideoBtn.setTextColor(Color.WHITE); byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner); byphoneBtn.setTextColor(Color.GRAY); if (layout.getChildCount() > 0) layout.removeAllViews(); } }); byphoneBtnLayout.setVisibility(View.VISIBLE); byphoneBtnLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner); byphoneBtn.setTextColor(Color.WHITE); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner); byvideoBtn.setTextColor(Color.GRAY); } }); } else if (position.equalsIgnoreCase("phone")) { saveConsultationType("Phone", this); byvideoBtnLayout.setVisibility(View.VISIBLE); byvideoBtnLayout.setClickable(false); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner); byvideoBtn.setTextColor(Color.GRAY); byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner); byphoneBtn.setTextColor(Color.WHITE); byphoneBtnLayout.setVisibility(View.VISIBLE); byphoneBtnLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner); byphoneBtn.setTextColor(Color.WHITE); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner); byvideoBtn.setTextColor(Color.GRAY); } }); } }
From source file:dev.memento.MainActivity.java
/** * Converts the given drawable to a gray image. This method may be * used to simulate the color of disable icons in Honeycomb's ActionBar. * //from w w w .j a v a2 s . co m * @return a version of the given drawable with a color filter applied. */ private Drawable convertDrawableToGrayScale(Drawable drawable) { if (drawable == null) return null; Drawable res = drawable.mutate(); res.setColorFilter(Color.GRAY, Mode.SRC_IN); return res; }
From source file:com.nest5.businessClient.Initialactivity.java
private void makeDailyTable(int TABLE_TYPE) { dailyTable.removeAllViews();/* w w w . java2 s.co m*/ Double total = 0.0; DecimalFormat dec = new DecimalFormat("$###,###,###"); TextView tv = new TextView(mContext); tv.setBackgroundColor(Color.parseColor("#80808080")); tv.setHeight(2); TableRow tr1 = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null); TextView tDate1 = (TextView) tr1.findViewById(R.id.cell_date); TextView tItem1 = (TextView) tr1.findViewById(R.id.cell_item); TextView tAccount1 = (TextView) tr1.findViewById(R.id.cell_account); TextView tVal1 = (TextView) tr1.findViewById(R.id.cell_value); TextView tTot1 = (TextView) tr1.findViewById(R.id.cell_total); tDate1.setText("FECHA"); tAccount1.setText("CUENTA"); tItem1.setText("ITEM"); tVal1.setText("VALOR"); tTot1.setText("TOTAL"); tr1.setBackgroundColor(Color.CYAN); dailyTable.addView(tr1); dailyTable.addView(tv); //actualizar sales de hoy Calendar today = Calendar.getInstance(); Calendar tomorrow = Calendar.getInstance(); today.set(Calendar.HOUR, 0); today.set(Calendar.HOUR_OF_DAY, 0); today.set(Calendar.MINUTE, 0); today.set(Calendar.SECOND, 0); today.set(Calendar.MILLISECOND, 0); tomorrow.roll(Calendar.DATE, 1); tomorrow.set(Calendar.HOUR, 0); tomorrow.set(Calendar.HOUR_OF_DAY, 0); tomorrow.set(Calendar.MINUTE, 0); tomorrow.set(Calendar.SECOND, 0); tomorrow.set(Calendar.MILLISECOND, 0); init = today.getTimeInMillis(); end = tomorrow.getTimeInMillis(); Log.d("GUARDANDOVENTA", today.toString()); Log.d("GUARDANDOVENTA", tomorrow.toString()); Calendar now = Calendar.getInstance(); now.setTimeInMillis(System.currentTimeMillis()); Log.d(TAG, now.toString()); Log.d(TAG, "Diferencia entre tiempos: " + String.valueOf(end - init)); salesFromToday = saleDataSource.getAllSalesWithin(init, end); List<Sale> usingSales = salesFromToday; switch (TABLE_TYPE) { case TABLE_TYPE_TODAY: usingSales = salesFromToday; break; case TABLE_TYPE_ALL: usingSales = saleList; break; } for (Sale currentSale : usingSales) { double totalLocal = 0.0; LinkedHashMap<Combo, Double> combos = currentSale.getCombos(); LinkedHashMap<Product, Double> products = currentSale.getProducts(); LinkedHashMap<Ingredient, Double> ingredients = currentSale.getIngredients(); Log.w("DAYILETABLES", " " + combos.size() + " " + products.size() + " " + ingredients.size()); Iterator<Entry<Combo, Double>> it = combos.entrySet().iterator(); Calendar date = Calendar.getInstance(); date.setTimeInMillis(currentSale.getDate()); String fecha = date.get(Calendar.MONTH) + "/" + date.get(Calendar.DAY_OF_MONTH) + "/" + date.get(Calendar.YEAR) + "\n" + date.get(Calendar.HOUR_OF_DAY) + ":" + date.get(Calendar.MINUTE) + ":" + date.get(Calendar.SECOND); String account = currentSale.getPaymentMethod(); while (it.hasNext()) { TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null); TextView tDate = (TextView) tr.findViewById(R.id.cell_date); TextView tItem = (TextView) tr.findViewById(R.id.cell_item); TextView tAccount = (TextView) tr.findViewById(R.id.cell_account); TextView tVal = (TextView) tr.findViewById(R.id.cell_value); TextView tTot = (TextView) tr.findViewById(R.id.cell_total); Map.Entry<Combo, Double> pair = (Map.Entry<Combo, Double>) it.next(); Double value = pair.getValue() * pair.getKey().getPrice(); tDate.setText(fecha); tAccount.setText(account); tItem.setText(pair.getKey().getName() + " en Combo"); tVal.setText(dec.format(value)); tTot.setText("----"); total += value; totalLocal += value; dailyTable.addView(tr); // Log.d("INGREDIENTES","INGREDIENTE: "+ingrediente.getKey().getName()+" "+ingrediente.getValue()); } Iterator<Entry<Product, Double>> it2 = products.entrySet().iterator(); while (it2.hasNext()) { Map.Entry<Product, Double> pair = (Map.Entry<Product, Double>) it2.next(); TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null); TextView tDate = (TextView) tr.findViewById(R.id.cell_date); TextView tItem = (TextView) tr.findViewById(R.id.cell_item); TextView tAccount = (TextView) tr.findViewById(R.id.cell_account); TextView tVal = (TextView) tr.findViewById(R.id.cell_value); TextView tTot = (TextView) tr.findViewById(R.id.cell_total); Double value = pair.getValue() * pair.getKey().getPrice(); tDate.setText(fecha); tAccount.setText(account); tItem.setText(pair.getKey().getName()); tVal.setText(dec.format(value)); tTot.setText("----"); total += value; totalLocal += value; dailyTable.addView(tr); // Log.d("INGREDIENTES","INGREDIENTE: "+ingrediente.getKey().getName()+" "+ingrediente.getValue()); } Iterator<Entry<Ingredient, Double>> it3 = ingredients.entrySet().iterator(); while (it3.hasNext()) { Map.Entry<Ingredient, Double> pair = (Map.Entry<Ingredient, Double>) it3.next(); TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null); TextView tDate = (TextView) tr.findViewById(R.id.cell_date); TextView tItem = (TextView) tr.findViewById(R.id.cell_item); TextView tAccount = (TextView) tr.findViewById(R.id.cell_account); TextView tVal = (TextView) tr.findViewById(R.id.cell_value); TextView tTot = (TextView) tr.findViewById(R.id.cell_total); Double value = pair.getValue() * pair.getKey().getPrice(); tDate.setText(fecha); tAccount.setText(account); tItem.setText(pair.getKey().getName()); tVal.setText(dec.format(value)); tTot.setText("----"); total += value; totalLocal += value; dailyTable.addView(tr); // Log.d("INGREDIENTES","INGREDIENTE: "+ingrediente.getKey().getName()+" "+ingrediente.getValue()); } TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null); TextView tDate = (TextView) tr.findViewById(R.id.cell_date); TextView tItem = (TextView) tr.findViewById(R.id.cell_item); TextView tAccount = (TextView) tr.findViewById(R.id.cell_account); TextView tVal = (TextView) tr.findViewById(R.id.cell_value); TextView tTot = (TextView) tr.findViewById(R.id.cell_total); tDate.setText(fecha); tAccount.setText("-------"); tItem.setText("Ingreso por Ventas"); tVal.setText("----"); tTot.setText(dec.format(totalLocal)); tr.setBackgroundColor(Color.LTGRAY); dailyTable.addView(tr); TableRow tr2 = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null); TextView tDate2 = (TextView) tr2.findViewById(R.id.cell_date); TextView tItem2 = (TextView) tr2.findViewById(R.id.cell_item); TextView tAccount2 = (TextView) tr2.findViewById(R.id.cell_account); TextView tVal2 = (TextView) tr2.findViewById(R.id.cell_value); TextView tTot2 = (TextView) tr2.findViewById(R.id.cell_total); tDate2.setText(fecha); tAccount2.setText("-------"); tItem2.setText("Acumulado por Ventas"); tVal2.setText("----"); tTot2.setText(dec.format(total)); tr2.setBackgroundColor(Color.GRAY); dailyTable.addView(tr2); } }
From source file:edu.usf.cutr.opentripplanner.android.fragments.MainFragment.java
/** * Draws rectangle in the map to represent the bounds, using selected * server fields for lower left and upper right coordinates. * * @param server from which coordinates will be pulled */// w w w. j ava 2s .com public void addBoundariesRectangle(Server server) { List<LatLng> bounds = new ArrayList<LatLng>(); bounds.add(new LatLng(server.getLowerLeftLatitude(), server.getLowerLeftLongitude())); bounds.add(new LatLng(server.getLowerLeftLatitude(), server.getUpperRightLongitude())); bounds.add(new LatLng(server.getUpperRightLatitude(), server.getUpperRightLongitude())); bounds.add(new LatLng(server.getUpperRightLatitude(), server.getLowerLeftLongitude())); bounds.add(new LatLng(server.getLowerLeftLatitude(), server.getLowerLeftLongitude())); PolylineOptions boundariesPolylineOptions = new PolylineOptions().addAll(bounds).color(Color.GRAY); mBoundariesPolyline = mMap.addPolyline(boundariesPolylineOptions); }