List of usage examples for android.graphics Color LTGRAY
int LTGRAY
To view the source code for android.graphics Color LTGRAY.
Click Source Link
From source file:org.openbitcoinwidget.WidgetProvider.java
private static int getColor(ColorMode colorMode, WidgetColor widgetColor) { if (colorMode.equals(ColorMode.Default)) { switch (widgetColor) { case Warning: return Color.parseColor("#ff3030"); case StartValue: return Color.YELLOW; case Normal: return Color.LTGRAY; case Increase: return Color.GREEN; case Decrease: return Color.parseColor("#ff3030"); default://from w ww . j av a 2 s .c o m throw new IllegalArgumentException("No color defined for " + widgetColor); } } else if (colorMode.equals(ColorMode.Grayscale)) { switch (widgetColor) { case Warning: return Color.WHITE; case StartValue: return Color.LTGRAY; case Normal: return Color.LTGRAY; case Increase: return Color.WHITE; case Decrease: return Color.GRAY; default: throw new IllegalArgumentException("No color defined for " + widgetColor); } } else { throw new IllegalArgumentException("No color mode defined for " + colorMode); } }
From source file:org.croudtrip.fragments.join.JoinDrivingFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Register local broadcasts LocalBroadcastManager.getInstance(getActivity()).registerReceiver(joinRequestExpiredReceiver, new IntentFilter(Constants.EVENT_JOIN_REQUEST_EXPIRED)); LocalBroadcastManager.getInstance(getActivity()).registerReceiver(nfcScannedReceiver, new IntentFilter(Constants.EVENT_NFC_TAG_SCANNED)); IntentFilter filter = new IntentFilter(); filter.addAction(Constants.EVENT_SECONDARY_DRIVER_ACCEPTED); filter.addAction(Constants.EVENT_SECONDARY_DRIVER_DECLINED); LocalBroadcastManager.getInstance(getActivity()).registerReceiver(secondaryDriverAcceptedDeclinedReceiver, filter);/*from w ww . jav a 2 s . c om*/ //Register nfc adapter nfcAdapter = NfcAdapter.getDefaultAdapter(getActivity()); if (nfcAdapter != null) { nfcPendingIntent = PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); } //Initialize colors for different routes on the map colors = new ArrayList<>(); colors.add(Color.BLUE); colors.add(Color.GREEN); colors.add(Color.RED); colors.add(Color.YELLOW); shadesOfGray = new ArrayList<>(); shadesOfGray.add(Color.GRAY); shadesOfGray.add(Color.DKGRAY); shadesOfGray.add(Color.LTGRAY); }
From source file:com.master.metehan.filtereagle.AdapterRule.java
public AdapterRule(Activity context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); this.context = context; this.filter = prefs.getBoolean("filter", false); if (prefs.getBoolean("dark_theme", false)) colorChanged = Color.argb(128, Color.red(Color.DKGRAY), Color.green(Color.DKGRAY), Color.blue(Color.DKGRAY)); else/*from ww w . j av a 2 s . c o m*/ colorChanged = Color.argb(128, Color.red(Color.LTGRAY), Color.green(Color.LTGRAY), Color.blue(Color.LTGRAY)); TypedArray ta = context.getTheme().obtainStyledAttributes(new int[] { android.R.attr.textColorSecondary }); try { colorText = ta.getColor(0, 0); } finally { ta.recycle(); } TypedValue tv = new TypedValue(); context.getTheme().resolveAttribute(R.attr.colorOn, tv, true); colorOn = tv.data; context.getTheme().resolveAttribute(R.attr.colorOff, tv, true); colorOff = tv.data; colorGrayed = ContextCompat.getColor(context, R.color.colorGrayed); iconSize = Util.dips2pixels(48, context); }
From source file:com.t2.compassionMeditation.DeviceManagerActivity.java
/** * Handles UI button clicks/*from ww w. j av a 2 s . c om*/ * @param v */ public void onButtonClick(final View v) { final int id = v.getId(); switch (id) { // Present a list of all parameter types to allow the user // to associate a specific device (address) to a specific parameter // This association will be used in the main activities so that they // know the BT address of particular sensors to tell them to start/stop // The associations are stored in Shared pref // key = param name (See R.array.parameter_names) // value = BT address case R.id.parameter: final String address = (String) v.getTag(); AlertDialog.Builder alertParamChooser = new AlertDialog.Builder(mInstance); alertParamChooser.setTitle("Select parameter for this device"); // mParamChooserAlert = alertParamChooser.create(); alertParamChooser.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); alertParamChooser.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); alertParamChooser.setSingleChoiceItems(R.array.parameter_names, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, final int which) { String[] paramNamesStringArray = getResources().getStringArray(R.array.parameter_names); final String name = paramNamesStringArray[which]; // See which pamrameter is associated with this name String device = SharedPref.getDeviceForParam(mInstance, name); if (device != null && which != 0) { AlertDialog.Builder alertWarning = new AlertDialog.Builder(mInstance); String message = String.format( "Another sensor (%s) currently feeds this parameter. Please change this previous mapping before trying again", device); alertWarning.setMessage(message); alertWarning.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mParamChooserAlert.dismiss(); } }); alertWarning.setNegativeButton("Select Anyway", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { Log.d(TAG, "param name = " + name + ", address = " + address); if (which != 0) { SharedPref.setParamForDevice(mInstance, name, address); v.getBackground().setColorFilter(Color.GREEN, PorterDuff.Mode.MULTIPLY); ((Button) v.findViewById(R.id.parameter)).setText(name); } else { SharedPref.setParamForDevice(mInstance, name, address); v.getBackground().setColorFilter(Color.LTGRAY, PorterDuff.Mode.MULTIPLY); ((Button) v.findViewById(R.id.parameter)).setText("Parameter"); } } }); alertWarning.show(); } else { // The parameter is currently not mapped to a sensor, so we can go ahead and map it Log.d(TAG, "param name = " + name + ", address = " + address); if (which != 0) { SharedPref.setParamForDevice(mInstance, name, address); v.getBackground().setColorFilter(Color.GREEN, PorterDuff.Mode.MULTIPLY); ((Button) v.findViewById(R.id.parameter)).setText(name); } else { SharedPref.setParamForDevice(mInstance, name, address); v.getBackground().setColorFilter(Color.LTGRAY, PorterDuff.Mode.MULTIPLY); ((Button) v.findViewById(R.id.parameter)).setText("Parameter"); } } } }); // alert.show(); mParamChooserAlert = alertParamChooser.create(); mParamChooserAlert.show(); break; } }
From source file:info.guardianproject.otr.app.im.app.ContactView.java
public void bind(Cursor cursor, String underLineText, boolean showChatMsg, boolean scrolling) { mHolder = (ViewHolder) getTag();/*from w w w .jav a 2 s .co m*/ long providerId = cursor.getLong(COLUMN_CONTACT_PROVIDER); String address = cursor.getString(COLUMN_CONTACT_USERNAME); String nickname = cursor.getString(COLUMN_CONTACT_NICKNAME); int type = cursor.getInt(COLUMN_CONTACT_TYPE); String statusText = cursor.getString(COLUMN_CONTACT_CUSTOM_STATUS); String lastMsg = cursor.getString(COLUMN_LAST_MESSAGE); int presence = cursor.getInt(COLUMN_CONTACT_PRESENCE_STATUS); if (!TextUtils.isEmpty(underLineText)) { // highlight/underline the word being searched String lowercase = nickname.toLowerCase(); int start = lowercase.indexOf(underLineText.toLowerCase()); if (start >= 0) { int end = start + underLineText.length(); SpannableString str = new SpannableString(nickname); str.setSpan(new UnderlineSpan(), start, end, Spannable.SPAN_INCLUSIVE_INCLUSIVE); mHolder.mLine1.setText(str); } else mHolder.mLine1.setText(nickname); } else mHolder.mLine1.setText(nickname); if (mHolder.mAvatar != null) { if (Imps.Contacts.TYPE_GROUP == type) { mHolder.mAvatar.setImageResource(R.drawable.group_chat); } else { Drawable avatar = DatabaseUtils.getAvatarFromCursor(cursor, COLUMN_AVATAR_DATA, ImApp.DEFAULT_AVATAR_WIDTH, ImApp.DEFAULT_AVATAR_HEIGHT); if (avatar != null) mHolder.mAvatar.setImageDrawable(avatar); else mHolder.mAvatar.setImageDrawable(mAvatarUnknown); } } if (showChatMsg && lastMsg != null) { if (mHolder.mAvatar != null) { setBackgroundResource(R.color.holo_blue_bright); mHolder.mLine1.setBackgroundColor(getResources().getColor(R.color.holo_blue_bright)); mHolder.mLine1.setTextColor(Color.WHITE); } else if (mHolder.mStatusBlock != null) { mHolder.mStatusBlock.setBackgroundColor(getResources().getColor(R.color.holo_blue_bright)); } if (mHolder.mLine2 != null) mHolder.mLine2.setText(android.text.Html.fromHtml(lastMsg).toString()); } else { if (mHolder.mLine2 != null) { if (statusText == null || statusText.length() == 0) { if (Imps.Contacts.TYPE_GROUP == type) { statusText = mContext.getString(R.string.menu_new_group_chat); } else { ImApp app = ((ImApp) ((Activity) mContext).getApplication()); BrandingResources brandingRes = app.getBrandingResource(providerId); statusText = brandingRes.getString(PresenceUtils.getStatusStringRes(presence)); } } mHolder.mLine2.setText(statusText); } if (presence == Imps.Presence.AVAILABLE) { if (mHolder.mAvatar != null) { setBackgroundColor(getResources().getColor(R.color.holo_green_light)); mHolder.mLine1.setBackgroundColor(getResources().getColor(R.color.holo_green_dark)); mHolder.mLine1.setTextColor(getResources().getColor(R.color.contact_status_fg_light)); } else if (mHolder.mStatusBlock != null) { mHolder.mStatusBlock.setBackgroundColor(getResources().getColor(R.color.holo_green_light)); } } else if (presence == Imps.Presence.AWAY || presence == Imps.Presence.IDLE) { if (mHolder.mAvatar != null) { setBackgroundColor(getResources().getColor(R.color.holo_orange_light)); mHolder.mLine1.setBackgroundColor(getResources().getColor(R.color.holo_orange_dark)); mHolder.mLine1.setTextColor(getResources().getColor(R.color.contact_status_fg_light)); } else if (mHolder.mStatusBlock != null) { mHolder.mStatusBlock.setBackgroundColor(getResources().getColor(R.color.holo_orange_light)); } } else if (presence == Imps.Presence.DO_NOT_DISTURB) { if (mHolder.mAvatar != null) { setBackgroundColor(getResources().getColor(R.color.holo_red_light)); mHolder.mLine1.setBackgroundColor(getResources().getColor(R.color.holo_red_dark)); mHolder.mLine1.setTextColor(getResources().getColor(R.color.contact_status_fg_light)); } else if (mHolder.mStatusBlock != null) { mHolder.mStatusBlock.setBackgroundColor(getResources().getColor(R.color.holo_red_light)); } } else { if (mHolder.mAvatar != null) { setBackgroundColor(Color.LTGRAY); mHolder.mLine1.setBackgroundColor(Color.LTGRAY); } else if (mHolder.mStatusBlock != null) { mHolder.mStatusBlock.setBackgroundColor(Color.LTGRAY); } } } }
From source file:org.wikipedia.page.shareafact.SnippetImage.java
private static void drawWordmarkFromStaticImage(@NonNull Context context, @NonNull Canvas canvas, boolean isArticleRTL) { // scaling it a bit down from original 317x54px size final int width = 130; final int height = 22; final int bottom = HEIGHT - BOTTOM_PADDING; final int top = bottom - height; Drawable d = ContextCompat.getDrawable(context, R.drawable.wp_wordmark); DrawableCompat.setTint(d, Color.LTGRAY); int left = WIDTH - HORIZONTAL_PADDING - width; if (isArticleRTL) { left = HORIZONTAL_PADDING;// w w w . j av a2 s . c o m } int right = left + width; d.setBounds(left, top, right, bottom); d.draw(canvas); }
From source file:opensourceproject.kanjisteps.Practice_slides.java
public void populateButtonChoicesMeaning(Cursor cursor, KanjiToStudyAdapter dbAdapter) { int[] answer_array = { 1, 2, 3, 4 }; shuffleArray(answer_array);/*from w w w. j a v a 2 s . co m*/ int indexOfKanji = cursor.getColumnIndex(dbAdapter.myKanjiDb.COLUMN_KANJI); String kanjiToExclude = cursor.getString(indexOfKanji); boolean correct_answer_set = false; for (int i = 0; i < 4; i++) { Button btn; if (answer_array[i] == 1) { btn = (Button) findViewById(R.id.btnMultipleChoice1); btn.getBackground().setColorFilter(Color.LTGRAY, PorterDuff.Mode.SRC_ATOP); } else if (answer_array[i] == 2) { btn = (Button) findViewById(R.id.btnMultipleChoice2); btn.getBackground().setColorFilter(Color.LTGRAY, PorterDuff.Mode.SRC_ATOP); } else if (answer_array[i] == 3) { btn = (Button) findViewById(R.id.btnMultipleChoice3); btn.getBackground().setColorFilter(Color.LTGRAY, PorterDuff.Mode.SRC_ATOP); } else { btn = (Button) findViewById(R.id.btnMultipleChoice4); btn.getBackground().setColorFilter(Color.LTGRAY, PorterDuff.Mode.SRC_ATOP); } //indexes of onyomi and kanji to access columns. int indexOfMeaning = cursor.getColumnIndex(dbAdapter.myKanjiDb.COLUMN_MEANING); //grab the onyomi and kanji strings from where the cursor is pointing RIGHT NOW String meaning = cursor.getString(indexOfMeaning); //reset cursor to grab new set of data, this time it can have all levels //but it will EXCLUDE the row with the kanji we are loading in below. if (!correct_answer_set) { cursor = dbAdapter.getItemsByLevel_excludeMeaning(level_marker, kanjiToExclude); correctAnswer = Integer.toString(answer_array[i]); } correct_answer_set = true; cursor.moveToNext(); btn.setText(meaning); } }
From source file:com.joker.graphs.JokerStatisticsUserRegist.java
/** * //from ww w . j a v a 2s . co m */ protected void setChartStyle() { // int[] colors = new int[years]; PointStyle[] styles = new PointStyle[years]; for (int i = 0; i < years; i++) { colors[i] = COLORS[i % COLORS.length]; styles[i] = STYLES[i % STYLES.length]; } // mRenderer = buildRenderer(colors, styles, false); setChartSettings(mRenderer, "", "X Month", "Y Count", 1, 12, 0, max_value, Color.LTGRAY, Color.LTGRAY); // int length = mRenderer.getSeriesRendererCount(); for (int i = 0; i < length; i++) { ((XYSeriesRenderer) mRenderer.getSeriesRendererAt(i)).setFillPoints(true); } }
From source file:de.anderdonau.hackersdiet.MonthDetailFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments().containsKey(ARG_ITEM_ID)) { mItem = MonthListContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID)); } else {//ww w. j a v a 2 s. c om return; } graphView = new LineGraphView(MonthListActivity.getAppContext(), ""); GraphViewStyle gStyle = graphView.getGraphViewStyle(); mToday = new GregorianCalendar(); mWeight = MonthListActivity.getmWeightData(); gStyle.setGridColor(Color.LTGRAY); gStyle.setHorizontalLabelsColor(Color.BLACK); gStyle.setVerticalLabelsColor(Color.BLACK); gStyle.setNumVerticalLabels(5); gStyle.setNumHorizontalLabels(9); gStyle.setLegendWidth(140); //graphView.setViewPort(1, 10); //graphView.setScalable(true); //graphView.setScrollable(true); graphView.setShowLegend(true); graphView.setLegendAlign(GraphView.LegendAlign.BOTTOM); graphView.setBackgroundColor(Color.DKGRAY); graphView.setCustomLabelFormatter(new CustomLabelFormatter() { @Override public String formatLabel(double value, boolean isValueX) { if (isValueX) { return String.format("%.0f", value); } return String.format("%.1f", value); } }); }