List of usage examples for android.graphics Color DKGRAY
int DKGRAY
To view the source code for android.graphics Color DKGRAY.
Click Source Link
From source file:com.jackpan.TaiwanpetadoptionApp.HeadpageActivity.java
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// requestWindowFeature(Window.FEATURE_NO_TITLE);// ?APP setContentView(R.layout.activity_headpage); ConnectivityManager conManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo networInfo = conManager.getActiveNetworkInfo(); if (networInfo == null || !networInfo.isAvailable()) { new AlertDialog.Builder(HeadpageActivity.this).setTitle(getString(R.string.Network_status)) .setMessage(getString(R.string.no_network)).setCancelable(false) .setPositiveButton(getString(R.string.setting), new DialogInterface.OnClickListener() { @Override// www. j a v a 2 s .c o m public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent settintIntent = new Intent(android.provider.Settings.ACTION_SETTINGS); startActivity(settintIntent); } }).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub HeadpageActivity.this.finish(); } }).show(); } else { final ProgressDialog progressDialog = ProgressDialog.show(HeadpageActivity.this, getString(R.string.Network_in), getString(R.string.waitting)); final Handler handler = new Handler(); final Runnable runnable = new Runnable() { @Override public void run() { // TODO Auto-generated method stub new AlertDialog.Builder(HeadpageActivity.this); progressDialog.dismiss(); } }; Thread thread = new Thread() { @Override public void run() { try { Thread.sleep(1500); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } handler.post(runnable); } }; thread.start(); } final TextView test = (TextView) findViewById(R.id.textView1); Timer timer = new Timer(); TimerTask task = new TimerTask() { public void run() { runOnUiThread(new Runnable() { public void run() { if (change) { change = false; test.setTextColor(Color.TRANSPARENT); // ? } else { change = true; test.setTextColor(Color.DKGRAY); } } }); } }; timer.schedule(task, 1, 800); // ?(timer???) mHelper = new IabHelper(this, getString(R.string.my_license_key)); mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() { public void onIabSetupFinished(IabResult result) { if (!result.isSuccess()) { MySharedPrefernces.saveIsBuyed(HeadpageActivity.this, false); } else { MySharedPrefernces.saveIsBuyed(HeadpageActivity.this, false); mHelper.queryInventoryAsync(mGotInventoryListener); } } }); GetButtonView(); setButtonEvent(); buildGoogleApiClient(); }
From source file:org.mixare.MixListView.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // mixCtx = MixView.ctx; dataView = MixView.dataView;//from w w w . ja v a 2s . co m ctx = this; mixContext = dataView.getContext(); switch (list) { case 1: adapter = new ListItemAdapter(this); //adapter.colorSource(getDataSource()); getListView().setTextFilterEnabled(true); setListAdapter(adapter); break; case 2: selectedItem = new Vector<Marker>(); listViewMenu = new Vector<SpannableString>(); DataHandler jLayer = dataView.getDataHandler(); /*add all marker items to a title and a URL Vector*/ for (int i = 0; i < jLayer.getMarkerCount(); i++) { Marker ma = jLayer.getMarker(i); if (ma.isActive()) { listViewMenu.add(new SpannableString(ma.getTitle())); selectedItem.add(ma); } } if (dataView.isFrozen()) { TextView searchNotificationTxt = new TextView(this); searchNotificationTxt.setVisibility(View.VISIBLE); searchNotificationTxt.setText(getString(DataView.SEARCH_ACTIVE_1) + " " + DataSourceList.getDataSourcesStringList() + getString(DataView.SEARCH_ACTIVE_2)); searchNotificationTxt.setWidth(MixView.dWindow.getWidth()); searchNotificationTxt.setPadding(10, 2, 0, 0); searchNotificationTxt.setBackgroundColor(Color.DKGRAY); searchNotificationTxt.setTextColor(Color.WHITE); getListView().addHeaderView(searchNotificationTxt); } setListAdapter( new ArrayAdapter<SpannableString>(this, android.R.layout.simple_list_item_1, listViewMenu)); getListView().setTextFilterEnabled(true); break; case 3: String addr = this.getIntent().getExtras().getString("address"); Map<String, Location> locs = DataInterface.getRouteSuggestions(addr); suggestionItems = new Vector<String>(); suggestionLocations = new Vector<Location>(); for (Map.Entry<String, Location> l : locs.entrySet()) { suggestionItems.add(l.getKey()); suggestionLocations.add(l.getValue()); } setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, suggestionItems)); getListView().setTextFilterEnabled(true); break; } }
From source file:com.ruesga.rview.widget.ActivityStatsChart.java
public ActivityStatsChart(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); final Resources r = getResources(); setLayerType(View.LAYER_TYPE_SOFTWARE, null); int color = Color.DKGRAY; int textColor = Color.WHITE; Resources.Theme theme = context.getTheme(); TypedArray a = theme.obtainStyledAttributes(attrs, R.styleable.ActivityStatsChart, defStyleAttr, 0); int n = a.getIndexCount(); for (int i = 0; i < n; i++) { int attr = a.getIndex(i); switch (attr) { case R.styleable.ActivityStatsChart_charLineColor: color = a.getColor(attr, color); break; case R.styleable.ActivityStatsChart_charLineTextColor: textColor = a.getColor(attr, textColor); break; }//from w ww . j a v a2 s. c o m } a.recycle(); mLinePaint = new Paint(); mLinePaint.setStyle(Paint.Style.STROKE); mLinePaint.setColor(color); mLinePaint.setStrokeWidth( TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1.5f, r.getDisplayMetrics())); mAreaPaint = new Paint(mLinePaint); mAreaPaint.setStyle(Paint.Style.FILL); mAreaPaint.setAlpha(180); mGridLinesPaint = new Paint(); mGridLinesPaint.setStyle(Paint.Style.STROKE); mGridLinesPaint.setColor(textColor); mGridLinesPaint.setStrokeWidth( TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 0.5f, r.getDisplayMetrics())); mGridLinesPaint.setAlpha(90); mGridLinesPaint.setPathEffect(new DashPathEffect(new float[] { 10, 10 }, 0)); mTicksPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG | Paint.LINEAR_TEXT_FLAG); mTicksPaint.setColor(textColor); mTicksPaint.setTextAlign(Paint.Align.RIGHT); mTicksPaint.setAlpha(180); mTicksPaint.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 8f, r.getDisplayMetrics())); // Ensure we have a background. Otherwise it will not draw anything if (getBackground() == null) { setBackgroundColor(Color.TRANSPARENT); } }
From source file:com.example.vendrisample.HelloEffects.java
License:asdf
private void initEffect() { EffectFactory effectFactory = mEffectContext.getFactory(); if (mEffect != null) { mEffect.release();/*from ww w . j a v a2 s .co m*/ } /** * Initialize the correct effect based on the selected menu/action item */ switch (mCurrentEffect) { case R.id.none: break; case R.id.autofix: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_AUTOFIX); mEffect.setParameter("scale", 0.5f); break; case R.id.bw: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_BLACKWHITE); mEffect.setParameter("black", .1f); mEffect.setParameter("white", .7f); break; case R.id.brightness: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_BRIGHTNESS); mEffect.setParameter("brightness", 2.0f); break; case R.id.contrast: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_CONTRAST); mEffect.setParameter("contrast", 1.4f); break; case R.id.crossprocess: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_CROSSPROCESS); break; case R.id.documentary: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_DOCUMENTARY); break; case R.id.duotone: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_DUOTONE); mEffect.setParameter("first_color", Color.YELLOW); mEffect.setParameter("second_color", Color.DKGRAY); break; case R.id.filllight: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FILLLIGHT); mEffect.setParameter("strength", .8f); break; case R.id.fisheye: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FISHEYE); mEffect.setParameter("scale", .5f); break; case R.id.flipvert: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FLIP); mEffect.setParameter("vertical", true); break; case R.id.fliphor: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FLIP); mEffect.setParameter("horizontal", true); break; case R.id.grain: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_GRAIN); mEffect.setParameter("strength", 1.0f); break; case R.id.grayscale: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_GRAYSCALE); break; case R.id.lomoish: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_LOMOISH); break; case R.id.negative: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_NEGATIVE); break; case R.id.posterize: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_POSTERIZE); break; case R.id.rotate: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_ROTATE); mEffect.setParameter("angle", 180); break; case R.id.saturate: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_SATURATE); mEffect.setParameter("scale", .5f); break; case R.id.sepia: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_SEPIA); break; case R.id.sharpen: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_SHARPEN); break; case R.id.temperature: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_TEMPERATURE); mEffect.setParameter("scale", .9f); break; case R.id.tint: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_TINT); mEffect.setParameter("tint", Color.MAGENTA); break; case R.id.vignette: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_VIGNETTE); mEffect.setParameter("scale", .5f); break; default: break; } }
From source file:io.plaidapp.ui.FeedAdapter.java
public FeedAdapter(Activity hostActivity, DataLoadingSubject dataLoading, int columns, boolean pocketInstalled) { this.host = hostActivity; this.dataLoading = dataLoading; dataLoading.registerCallback(this); this.columns = columns; this.pocketIsInstalled = pocketInstalled; layoutInflater = LayoutInflater.from(host); comparator = new PlaidItemSorting.PlaidItemComparator(); items = new ArrayList<>(); setHasStableIds(true);/*w w w . j a v a 2s .c o m*/ // get the dribbble shot placeholder colors & badge color from the theme final TypedArray a = host.obtainStyledAttributes(R.styleable.DribbbleFeed); final int loadingColorArrayId = a.getResourceId(R.styleable.DribbbleFeed_shotLoadingPlaceholderColors, 0); if (loadingColorArrayId != 0) { int[] placeholderColors = host.getResources().getIntArray(loadingColorArrayId); shotLoadingPlaceholders = new ColorDrawable[placeholderColors.length]; for (int i = 0; i < placeholderColors.length; i++) { shotLoadingPlaceholders[i] = new ColorDrawable(placeholderColors[i]); } } else { shotLoadingPlaceholders = new ColorDrawable[] { new ColorDrawable(Color.DKGRAY) }; } final int initialGifBadgeColorId = a.getResourceId(R.styleable.DribbbleFeed_initialBadgeColor, 0); initialGifBadgeColor = initialGifBadgeColorId != 0 ? ContextCompat.getColor(host, initialGifBadgeColorId) : 0x40ffffff; a.recycle(); }
From source file:org.csploit.android.plugins.LoginCracker.java
private void setStoppedState() { if (mProcess != null) { mProcess.kill();/*from w w w . ja va 2s. co m*/ mProcess = null; } mRunning = false; LoginCracker.this.runOnUiThread(new Runnable() { @Override public void run() { mActivity.setVisibility(View.INVISIBLE); mProgressBar.setProgress(0); mStartButton.setImageDrawable( ContextCompat.getDrawable(getBaseContext(), R.drawable.ic_play_arrow_24dp)); if (!mAccountFound) { mStatusText.setTextColor(Color.DKGRAY); mStatusText.setText(getString(R.string.stopped_dots)); } } }); }
From source file:com.artitk.licensefragment.example.MainActivity.java
@Override public void onNavigationDrawerItemSelected(int position) { // if (true) return; FragmentManager fragmentManager = getFragmentManager(); Fragment fragment;/*from w w w .jav a 2 s . c om*/ ArrayList<Integer> licenseIds = new ArrayList<>(); licenseIds.add(LicenseID.GSON); licenseIds.add(LicenseID.RETROFIT); switch (position) { case 0: if (fragmentManager.findFragmentById(R.id.container) instanceof ScrollViewLicenseFragment) return; fragment = ScrollViewLicenseFragment.newInstance(licenseIds); // Call newInstance() using parameter ArrayList<Integer> break; case 1: if (fragmentManager.findFragmentById(R.id.container) instanceof ListViewLicenseFragment) return; fragment = ListViewLicenseFragment.newInstance(new int[] { LicenseID.PICASSO }) // Call newInstance() using parameter array .withLicenseChain(false); // Disable license chain break; case 2: if (fragmentManager.findFragmentById(R.id.container) instanceof RecyclerViewLicenseFragment) return; ArrayList<License> licenses = new ArrayList<>(); licenses.add(new License(this, "Test Library 1", LicenseType.MIT_LICENSE, "2000-2001", "Test Owner 1")); licenses.add(new License(this, "Test Library 2", LicenseType.GPL_30, "2002", "Test Owner 2")); licenses.add(new License(this, "Test Library 3", LicenseType.EPL_10, "2003", "Test Owner 3")); licenses.add(new License(this, "Custom License 1", R.raw.wtfpl, "2004", "Test Owner 3")); licenses.add(new License(this, "Custom License 2", R.raw.x11, "2005", "Test Owner 4")); fragment = RecyclerViewLicenseFragment.newInstance() // Call newInstance() using without parameter .setLog(true) // Enable Log .withLicenseChain(true) // Enable license chain (default) .addLicense(new int[] { LicenseID.PICASSO }) // Add array (same call newInstance) .addLicense(licenseIds) // Add ArrayList<Integer> (same call newInstance) .addCustomLicense(licenses) // Add Custom License .setCustomUI(new CustomUI() // Set Custom UI .setTitleBackgroundColor(Color.parseColor("#7fff7f")) .setTitleTextColor(getResources().getColor(android.R.color.holo_green_dark)) .setLicenseBackgroundColor(Color.rgb(127, 223, 127)).setLicenseTextColor(Color.DKGRAY)); break; default: return; } // ((LicenseFragmentBase) fragment).setLog(true); // update the main content by replacing fragments fragmentManager.beginTransaction().replace(R.id.container, fragment).commit(); fragmentId = position + 1; }
From source file:com.example.android.saddacampus.MainActivity.java
public void initSearchView() { final SearchView searchView = (SearchView) search_menu.findItem(R.id.action_filter_search).getActionView(); // Enable/Disable Submit button in the keyboard searchView.setSubmitButtonEnabled(false); // Change search close button image ImageView closeButton = (ImageView) searchView.findViewById(R.id.search_close_btn); closeButton.setImageResource(R.drawable.ic_action_search); // set hint and the text colors EditText txtSearch = ((EditText) searchView .findViewById(android.support.v7.appcompat.R.id.search_src_text)); txtSearch.setHint("Search.."); txtSearch.setHintTextColor(Color.DKGRAY); txtSearch.setTextColor(getResources().getColor(R.color.primary_color)); // set the cursor AutoCompleteTextView searchTextView = (AutoCompleteTextView) searchView .findViewById(android.support.v7.appcompat.R.id.search_src_text); try {/*from www.j a v a 2 s . c o m*/ Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes"); mCursorDrawableRes.setAccessible(true); mCursorDrawableRes.set(searchTextView, R.drawable.ic_action_search); //This sets the cursor resource ID to 0 or @null which will make it visible on white background } catch (Exception e) { e.printStackTrace(); } searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { callSearch(query); searchView.clearFocus(); return true; } @Override public boolean onQueryTextChange(String newText) { callSearch(newText); return true; } public void callSearch(String query) { //Do searching Log.i("query", "" + query); } }); }
From source file:ph.devcon.android.attendee.AttendeesFragment.java
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); // Inflate the menu; this adds items to the action bar if it is present. getActivity().getMenuInflater().inflate(R.menu.attendee, menu); MenuItem menuItem = menu.findItem(R.id.action_search); SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuItem); searchView/* w w w . j a v a 2 s. c om*/ .setQueryHint(Html.fromHtml("<font color = #808080>Find by name, address, company, etc..</font>")); int searchPlateId = searchView.getContext().getResources().getIdentifier("android:id/search_plate", null, null); View searchPlate = searchView.findViewById(searchPlateId); if (searchPlate != null) { searchPlate.setBackgroundColor(Color.DKGRAY); int searchTextId = searchPlate.getContext().getResources().getIdentifier("android:id/search_src_text", null, null); TextView searchText = (TextView) searchPlate.findViewById(searchTextId); if (searchText != null) { searchText.setTextColor(Color.DKGRAY); searchText.setHintTextColor(Color.DKGRAY); } } MenuItemCompat.setOnActionExpandListener(menuItem, new MenuItemCompat.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(MenuItem item) { return true; } @Override public boolean onMenuItemActionCollapse(MenuItem item) { return true; } }); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String s) { search(s); lastQuery = s; return false; } @Override public boolean onQueryTextChange(String s) { if (!Util.isNullOrEmpty(s)) { search(s); lastQuery = s; } return false; } }); }
From source file:com.example.android.mediaeffects.MediaEffectsFragment.java
private void initEffect() { EffectFactory effectFactory = mEffectContext.getFactory(); if (mEffect != null) { mEffect.release();//from w w w . ja v a 2 s . c o m } // Initialize the correct effect based on the selected menu/action item switch (mCurrentEffect) { case R.id.none: break; case R.id.autofix: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_AUTOFIX); mEffect.setParameter("scale", 0.5f); break; case R.id.bw: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_BLACKWHITE); mEffect.setParameter("black", .1f); mEffect.setParameter("white", .7f); break; case R.id.brightness: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_BRIGHTNESS); mEffect.setParameter("brightness", 2.0f); break; case R.id.contrast: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_CONTRAST); mEffect.setParameter("contrast", 1.4f); break; case R.id.crossprocess: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_CROSSPROCESS); break; case R.id.documentary: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_DOCUMENTARY); break; case R.id.duotone: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_DUOTONE); mEffect.setParameter("first_color", Color.YELLOW); mEffect.setParameter("second_color", Color.DKGRAY); break; case R.id.filllight: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FILLLIGHT); mEffect.setParameter("strength", .8f); break; case R.id.fisheye: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FISHEYE); mEffect.setParameter("scale", .5f); break; case R.id.flipvert: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FLIP); mEffect.setParameter("vertical", true); break; case R.id.fliphor: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_FLIP); mEffect.setParameter("horizontal", true); break; case R.id.grain: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_GRAIN); mEffect.setParameter("strength", 1.0f); break; case R.id.grayscale: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_GRAYSCALE); break; case R.id.lomoish: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_LOMOISH); break; case R.id.negative: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_NEGATIVE); break; case R.id.posterize: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_POSTERIZE); break; case R.id.rotate: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_ROTATE); mEffect.setParameter("angle", 180); break; case R.id.saturate: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_SATURATE); mEffect.setParameter("scale", .5f); break; case R.id.sepia: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_SEPIA); break; case R.id.sharpen: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_SHARPEN); break; case R.id.temperature: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_TEMPERATURE); mEffect.setParameter("scale", .9f); break; case R.id.tint: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_TINT); mEffect.setParameter("tint", Color.MAGENTA); break; case R.id.vignette: mEffect = effectFactory.createEffect(EffectFactory.EFFECT_VIGNETTE); mEffect.setParameter("scale", .5f); break; default: break; } }