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.by_syk.lib.nanoiconpack.dialog.IconDialog.java
private SpannableString getTitle(@NonNull IconBean bean) { TextTag.Builder builder = new TextTag.Builder() .text(iconBean.getLabel() != null ? iconBean.getLabel() : iconBean.getName()).bgColor(Color.GRAY); if (!bean.isRecorded()) { builder.tag(getString(R.string.icon_tag_undefined)); } else if (!bean.isDef()) { builder.tag(getString(R.string.icon_tag_alternative)); }// ww w .ja va 2 s . co m return builder.build().render(); }
From source file:com.roamprocess1.roaming4world.ui.calllog.CallLogListFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) { System.out.println("CallLogListFragment onCreateView"); v = inflater.inflate(R.layout.call_log_fragment, container, false); dbContacts = new DBContacts(getActivity()); lv_missedcall = (ListView) v.findViewById(R.id.lv_missed_Calls); btn_callLog_allCalls = (Button) v.findViewById(R.id.btn_callLog_allCalls); btn_callLog_MissedCalls = (Button) v.findViewById(R.id.btn_callLog_MissedCalls); prefs = getActivity().getSharedPreferences("com.roamprocess1.roaming4world", Context.MODE_PRIVATE); btn_callLog_allCalls.setOnClickListener(new View.OnClickListener() { @Override/*from ww w . j ava 2 s. c o m*/ public void onClick(View v) { btn_callLog_allCalls.setBackgroundColor(Color.parseColor("#189AD1")); btn_callLog_MissedCalls.setBackgroundColor(Color.GRAY); } }); btn_callLog_MissedCalls.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub btn_callLog_MissedCalls.setBackgroundColor(Color.parseColor("#189AD1")); btn_callLog_allCalls.setBackgroundColor(Color.GRAY); getFragmentManager().beginTransaction().replace(R.id.Frame_Layout, new MissedcallFragment()) .commitAllowingStateLoss(); } }); btn_callLog_allCalls.setBackgroundColor(Color.parseColor("#189AD1")); btn_callLog_MissedCalls.setBackgroundColor(Color.GRAY); return v; }
From source file:com.grupohqh.carservices.operator.ManipulateCarActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_manipulate_car); if (getIntent().getExtras().containsKey("userId")) userId = getIntent().getExtras().getInt("userId"); if (getIntent().getExtras().containsKey("carOwnerId")) carOwnerId = getIntent().getExtras().getInt("carOwnerId"); CARBRAND_URL = getString(R.string.base_url) + getString(R.string.carbrands_url); CARLINE_URL = getString(R.string.base_url) + getString(R.string.carmodels_url); SAVECAR_URL = getString(R.string.base_url) + "savecar/"; SAVEPHOTO_URL = getString(R.string.base_url) + "savephoto/"; hasCamera = this.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY); etTagNumber = (EditText) findViewById(R.id.etTagNumber); etUsernameOwner = (EditText) findViewById(R.id.etUsernameOwner); etCarBrand = (EditText) findViewById(R.id.etCarBrand); etCarModel = (EditText) findViewById(R.id.etCarModel); etCarYear = (EditText) findViewById(R.id.etCarYear); etColor = (EditText) findViewById(R.id.etCarColor); etSerialNumber = (EditText) findViewById(R.id.etSerialNumber); etLicensePlate = (EditText) findViewById(R.id.etLicensePlate); etKM = (EditText) findViewById(R.id.etKm); imgCar = (ImageView) findViewById(R.id.imgCar); spCarBrand = (Spinner) findViewById(R.id.spCarBrand); spCarModel = (Spinner) findViewById(R.id.spCarModel); btnSaveCar = (Button) findViewById(R.id.btnSaveCar); btnTakePicture = (Button) findViewById(R.id.btnTakePicture); bar = (ProgressBar) findViewById(R.id.progressBar); viewUsername = findViewById(R.id.viewUsername); if (savedInstanceState != null) { bm = savedInstanceState.getParcelable("bm"); if (bm != null) imgCar.setImageBitmap(bm);// w ww . j a v a2s . co m } bar.setVisibility(View.GONE); etCarBrand.setVisibility(View.GONE); etCarModel.setVisibility(View.GONE); viewUsername.setVisibility(carOwnerId == 0 ? View.VISIBLE : View.GONE); btnTakePicture.setEnabled(hasCamera); btnTakePicture.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(getTempFile(ManipulateCarActivity.this))); startActivityForResult(intent, CAPTURE_IMAGE); } }); btnSaveCar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (validate()) new SaveCarAsyncTask().execute(SAVECAR_URL); } }); spCarBrand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position == 0) ((TextView) parent.getChildAt(position)).setTextColor(Color.GRAY); if (mapBrands.get(brands.get(position)) == otherId) { etCarBrand.setVisibility(View.VISIBLE); etCarModel.setVisibility(View.VISIBLE); spCarModel.setVisibility(View.GONE); etCarBrand.requestFocus(); } else { etCarBrand.setVisibility(View.GONE); etCarModel.setVisibility(View.GONE); spCarModel.setVisibility(View.VISIBLE); new LoadCarModelsAsyncTask().execute(CARLINE_URL + mapBrands.get(brands.get(position)) + "/"); reload = true; } } @Override public void onNothingSelected(AdapterView<?> parent) { } }); spCarModel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position == 0) ((TextView) parent.getChildAt(position)).setTextColor(Color.GRAY); if (mapModels.get(models.get(position)) == otherId) { etCarModel.setVisibility(View.VISIBLE); etCarModel.requestFocus(); } else { etCarModel.setVisibility(View.GONE); } } @Override public void onNothingSelected(AdapterView<?> parent) { } }); if (useMiniMe) { manager = (UsbManager) getSystemService(Context.USB_SERVICE); usbCommunication = UsbCommunication.newInstance(); IntentFilter filter = new IntentFilter(); filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); // will intercept by system filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); filter.addAction(ACTION_USB_PERMISSION); registerReceiver(usbReceiver, filter); etEPC = (EditText) findViewById(R.id.etEPC); btnReadTAG = (Button) findViewById(R.id.btnReadTAG); txtStatus = (TextView) findViewById(R.id.txtStatus); btnReadTAG.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { etEPC.setText(""); if (txtStatus.getText().toString().equals("conectado")) { readTag(); } else { Toast.makeText(getBaseContext(), "dispositivo " + txtStatus.getText(), Toast.LENGTH_LONG) .show(); } } }); } etKM.addTextChangedListener(new NumberTextWatcher(etKM)); }
From source file:com.tct.email.activity.setup.EmailPreferenceActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Intent i = getIntent(); if (savedInstanceState == null) { // If we are not restarting from a previous instance, we need to // figure out the initial prefs to show. (Otherwise, we want to // continue showing whatever the user last selected.) if (INTENT_ACCOUNT_MANAGER_ENTRY == null) { INTENT_ACCOUNT_MANAGER_ENTRY = getString(R.string.intent_account_manager_entry); }//from w ww .ja v a2 s.c om if (INTENT_ACCOUNT_MANAGER_ENTRY.equals(i.getAction())) { // This case occurs if we're changing account settings from Settings -> Accounts. // We get an account object in the intent, but it's not actually useful to us since // it's always just the first account of that type. The user can't specify which // account they wish to view from within the settings UI, so just dump them at the // main screen. // android.accounts.Account acct = i.getParcelableExtra("account"); } else if (i.hasExtra(EditSettingsExtras.EXTRA_FOLDER)) { throw new IllegalArgumentException("EXTRA_FOLDER is no longer supported"); } else { // Otherwise, we're called from within the Email app and look for our extras final long accountId = IntentUtilities.getAccountIdFromIntent(i); if (accountId != -1) { final Bundle args = AccountSettingsFragment.buildArguments(accountId); startPreferencePanel(AccountSettingsFragment.class.getName(), args, 0, null, null, 0); // TS: jin.dong 2015-08-07 EMAIL BUGFIX_989528 ADD_S finish(); return; // TS: jin.dong 2015-08-07 EMAIL BUGFIX_989528 ADD_E } } } mShowDebugMenu = i.getBooleanExtra(EXTRA_ENABLE_DEBUG, false); final ActionBar actionBar = getActionBar(); if (actionBar != null) { actionBar.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP); } ListView listView = getListView(); if (listView != null) { listView.setDivider(new ColorDrawable(Color.GRAY)); listView.setDividerHeight(1); } mFeedbackUri = Utils.getValidUri(getString(R.string.email_feedback_uri)); }
From source file:org.nla.tarotdroid.lib.ui.charts.GameScoresEvolutionChartFragment.java
@Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { List<double[]> scores = this.statisticsComputer.getScores(); XYMultipleSeriesRenderer renderer = this.buildRenderer(this.statisticsComputer.getScoresColors(), this.getScoresPointStyles()); this.setChartSettings(renderer, "", AppContext.getApplication().getResources().getString(R.string.lblScoreEvolutionGames), AppContext.getApplication().getResources().getString(R.string.lblScoreEvolutionPoints), 0, this.statisticsComputer.getGameCount() + 1, this.statisticsComputer.getMaxAbsoluteScore() * -1 - 100, this.statisticsComputer.getMaxAbsoluteScore() + 100, Color.GRAY, Color.LTGRAY); return ChartFactory.getLineChartView(this.getActivity(), this.buildDataset(this.statisticsComputer.getPlayerNames(), scores), renderer); }
From source file:com.progym.custom.fragments.FoodCalloriesProgressYearlyLineFragment.java
public void setYearProgressData(Date date) { int yMaxAxisValue = 0; try {//from ww w. j av a 2 s . c o m rlRootGraphLayout.removeView(viewChart); } catch (Exception edsx) { edsx.printStackTrace(); } 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 January as first month date.setMonth(0); date.setDate(1); int[] x = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); CategorySeries seriesCallories = new CategorySeries("Callories"); List<Ingridient> list; for (int i = 0; i < x.length; i++) { list = DataBaseUtils .getAllFoodConsumedInMonth(Utils.formatDate(date, DataBaseUtils.DATE_PATTERN_YYYY_MM)); // init "average" data int totalCallories = 0; for (Ingridient ingridient : list) { totalCallories += ingridient.kkal; } // add value to series seriesCallories.add(totalCallories / daysInMonth); // calculate maximum Y axis values yMaxAxisValue = Math.max(yMaxAxisValue, totalCallories / daysInMonth); // increment month date = DateUtils.addMonths(date, 1); } int[] colors = new int[] { getActivity().getResources().getColor(R.color.purple) }; XYMultipleSeriesRenderer renderer = buildBarRenderer(colors); setChartSettings(renderer, String.format("Callories statistic for %s year", Utils.getSpecificDateValue(DATE, "yyyy")), "Months", "Amount (g)", 0.7, 12.3, 0, yMaxAxisValue + 30, Color.GRAY, Color.LTGRAY); renderer.getSeriesRendererAt(0).setDisplayChartValues(true); renderer.getSeriesRendererAt(0).setChartValuesTextSize(15f); renderer.setXLabels(0); renderer.setClickEnabled(false); renderer.setZoomEnabled(false); renderer.setPanEnabled(false, false); renderer.setZoomButtonsVisible(false); renderer.setPanLimits(new double[] { 1, 11 }); renderer.setShowGrid(true); renderer.setShowLegend(true); renderer.setFitLegend(true); for (int i = 0; i < ActivityWaterProgress.months_short.length; i++) { renderer.addXTextLabel(i + 1, ActivityWaterProgress.months_short[i]); } dataset.addSeries(seriesCallories.toXYSeries()); viewChart = ChartFactory.getBarChartView(getActivity(), dataset, renderer, Type.DEFAULT); rlRootGraphLayout.addView(viewChart, 0); }
From source file:com.normalexception.app.rx8club.view.category.CategoryView.java
/** * Set the mode of the category line// ww w .j av a2s . c o m * @param vi The view line * @param isTitle If we are going to represent a title */ private void setMode(View vi, boolean isTitle) { int showMode = isTitle ? View.GONE : View.VISIBLE; int colorMode = isTitle ? Color.DKGRAY : Color.GRAY; int textColor = isTitle ? Color.WHITE : Color.BLACK; postCount.setVisibility(showMode); postCountLabel.setVisibility(showMode); threadCount.setVisibility(showMode); threadCountLabel.setVisibility(showMode); subCount.setVisibility(showMode); subCountLabel.setVisibility(showMode); image.setVisibility(showMode); vi.setBackgroundColor(colorMode); title.setTextColor(textColor); }
From source file:com.pixby.texo.EditTools.ColorTool.java
private boolean isPresetColor(@ColorInt int color) { return color == Color.WHITE || color == Color.GRAY || color == Color.BLACK; }
From source file:com.ariesmcrae.mymemories.ui.story.EditStoryFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.story_edit_fragment, container, false); container.setBackgroundColor(Color.GRAY); return view;/*from w w w.j ava 2s . c om*/ }
From source file:at.flack.FacebookMainActivity.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (((MainActivity) getActivity()).existsCookie()) { View rootView = inflater.inflate(R.layout.fragment_fb_main, container, false); contactList = (ListView) rootView.findViewById(R.id.listview); loadmore = new LoadMoreAdapter(inflater.inflate(R.layout.contacts_loadmore, contactList, false)); cantloadContacts = rootView.findViewById(R.id.nothing_found); TextView padding = new TextView(getActivity()); padding.setHeight(10);/*from w w w .j a va 2 s.c o m*/ contactList.addHeaderView(padding); contactList.setHeaderDividersEnabled(false); contactList.addFooterView(loadmore.getView(), null, false); contactList.setFooterDividersEnabled(false); smiley_helper = new SmileyKonverter(); swipe = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container); swipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).facebookLogin(); } }); contactList.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { int topRowVerticalPosition = (contactList == null || contactList.getChildCount() == 0) ? 0 : contactList.getChildAt(0).getTop(); swipe.setEnabled(topRowVerticalPosition >= 0); } }); loadmore.getView().setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { loadmore.setEnabled(false); loadMore(); } }); setProgressbar(rootView.findViewById(R.id.load_screen)); if (MainActivity.getFbcontacts() == null) getProgressbar().setVisibility(View.VISIBLE); updateContacts(getActivity()); contactList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { openMessageActivity(getActivity(), arg2 - 1); } }); FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab); fab.attachToListView(contactList); fab.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent qr = new Intent(getActivity(), NewFbContactActivity.class); startActivityForResult(qr, 1); } }); updateProfilePictures(getActivity()); setRetainInstance(true); return rootView; } else { View rootView = inflater.inflate(R.layout.fragment_facebook_login, container, false); final EditText mail = (EditText) rootView.findViewById(R.id.email); final EditText password = (EditText) rootView.findViewById(R.id.password); final Button login_button = (Button) rootView.findViewById(R.id.login_button); login_button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (mail.getText().length() <= 0) { Toast.makeText(FacebookMainActivity.this.getActivity(), getResources().getString(R.string.facebook_login_please_enter_valid_mail), Toast.LENGTH_SHORT).show(); return; } if (password.getText().length() <= 0) { Toast.makeText(FacebookMainActivity.this.getActivity(), getResources().getString(R.string.facebook_login_please_enter_valid_pw), Toast.LENGTH_SHORT).show(); return; } login_button.setEnabled(false); login_button.getBackground().setColorFilter(Color.GRAY, PorterDuff.Mode.MULTIPLY); if (((MainActivity) getActivity()).facebookLogin(mail.getText().toString(), password.getText().toString())) { } else { Toast.makeText(FacebookMainActivity.this.getActivity(), getResources().getString(R.string.facebook_login_incorrect_or_offline), Toast.LENGTH_SHORT).show(); password.setText(""); login_button.getBackground().setColorFilter(null); login_button.setEnabled(true); } } }); setRetainInstance(true); return rootView; } }