List of usage examples for android.graphics Color BLACK
int BLACK
To view the source code for android.graphics Color BLACK.
Click Source Link
From source file:com.aspsine.swipetoloadlayout.widget.CircleProgressBar.java
private void init(Context context, AttributeSet attrs, int defStyleAttr) { final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar, defStyleAttr, 0); // <attr name="mlpb_inner_radius" format="dimension"/> // <attr name="mlpb_background_color" format="color"/> // <attr name="mlpb_progress_color" format="color"/> // <attr name="mlpb_progress_stoke_width" format="dimension"/> // <attr name="mlpb_arrow_width" format="dimension"/> // <attr name="mlpb_arrow_height" format="dimension"/> ////from w ww . ja v a 2 s. c o m // <attr name="mlpb_progress" format="integer"/> // <attr name="mlpb_max" format="integer"/> // // // <attr name="mlpb_progress_text_size" format="dimension"/> // <attr name="mlpb_progress_text_color" format="color"/> // // <attr name="mlpb_progress_text_offset" format="dimension"/> // // <attr name="mlpb_progress_text_visibility" format="enum"> // <enum name="visible" value="0"/> // <enum name="invisible" value="1"/> // </attr> final float density = getContext().getResources().getDisplayMetrics().density; mBackGroundColor = a.getColor(R.styleable.CircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT); mProgressColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT); mColors = new int[] { mProgressColor }; mInnerRadius = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_inner_radius, -1); mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_stoke_width, (int) (STROKE_WIDTH_LARGE * density)); mArrowWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_width, -1); mArrowHeight = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_height, -1); mTextSize = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_text_size, (int) (DEFAULT_TEXT_SIZE * density)); mTextColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_text_color, Color.BLACK); mShowArrow = a.getBoolean(R.styleable.CircleProgressBar_mlpb_show_arrow, false); mCircleBackgroundEnabled = a.getBoolean(R.styleable.CircleProgressBar_mlpb_enable_circle_background, true); mProgress = a.getInt(R.styleable.CircleProgressBar_mlpb_progress, 0); mMax = a.getInt(R.styleable.CircleProgressBar_mlpb_max, 100); int textVisible = a.getInt(R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1); if (textVisible != 1) { mIfDrawText = true; } mTextPaint = new Paint(); mTextPaint.setStyle(Paint.Style.FILL); mTextPaint.setColor(mTextColor); mTextPaint.setTextSize(mTextSize); mTextPaint.setAntiAlias(true); a.recycle(); mProgressDrawable = new MaterialProgressDrawable(getContext(), this); super.setImageDrawable(mProgressDrawable); }
From source file:com.android.launcher3.dynamicui.ExtractedColors.java
/** * The hotseat's color is defined as follows: * - 12% black for super light wallpaper * - 18% white for super dark/*w w w.j a v a2 s. c o m*/ * - 25% white otherwise */ public void updateHotseatPalette(Palette hotseatPalette) { int hotseatColor; if (hotseatPalette != null && ExtractionUtils.isSuperLight(hotseatPalette)) { hotseatColor = ColorUtils.setAlphaComponent(Color.BLACK, (int) (0.12f * 255)); } else if (hotseatPalette != null && ExtractionUtils.isSuperDark(hotseatPalette)) { hotseatColor = ColorUtils.setAlphaComponent(Color.WHITE, (int) (0.18f * 255)); } else { hotseatColor = ColorUtils.setAlphaComponent(Color.WHITE, (int) (0.25f * 255)); } setColorAtIndex(HOTSEAT_INDEX, hotseatColor); }
From source file:cn.edu.bjtu.svnteen.nourriture.viewpagerindicator.TabPageIndicator.java
private void addTab(int index, CharSequence text, int iconResId) { final TabView tabView = new TabView(getContext()); tabView.mIndex = index;//from w w w .j av a 2 s . c o m tabView.setFocusable(true); tabView.setOnClickListener(mTabClickListener); tabView.setTextSize(14); tabView.setTextColor(Color.BLACK); tabView.setText(text); if (iconResId != 0) { tabView.setCompoundDrawablesWithIntrinsicBounds(iconResId, 0, 0, 0); } mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0, MATCH_PARENT, 1)); }
From source file:com.msport.clientmaster.view.CircleProgressBar.java
private void init(Context context, AttributeSet attrs, int defStyleAttr) { final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar, defStyleAttr, 0); // <attr name="mlpb_inner_radius" format="dimension"/> // <attr name="mlpb_background_color" format="color"/> // <attr name="mlpb_progress_color" format="color"/> // <attr name="mlpb_progress_stoke_width" format="dimension"/> // <attr name="mlpb_arrow_width" format="dimension"/> // <attr name="mlpb_arrow_height" format="dimension"/> ////from w w w . jav a 2s. com // <attr name="mlpb_progress" format="integer"/> // <attr name="mlpb_max" format="integer"/> // // // <attr name="mlpb_progress_text_size" format="dimension"/> // <attr name="mlpb_progress_text_color" format="color"/> // // <attr name="mlpb_progress_text_offset" format="dimension"/> // // <attr name="mlpb_progress_text_visibility" format="enum"> // <enum name="visible" value="0"/> // <enum name="invisible" value="1"/> // </attr> final float density = getContext().getResources().getDisplayMetrics().density; this.context = context; mBackGroundColor = a.getColor(R.styleable.CircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT); mProgressColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT); mColors = new int[] { mProgressColor }; mInnerRadius = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_inner_radius, -1); mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_stoke_width, (int) (STROKE_WIDTH_LARGE * density)); mArrowWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_width, -1); mArrowHeight = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_height, -1); mTextSize = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_text_size, (int) (DEFAULT_TEXT_SIZE * density)); mTextColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_text_color, Color.BLACK); mShowArrow = a.getBoolean(R.styleable.CircleProgressBar_mlpb_show_arrow, false); mCircleBackgroundEnabled = a.getBoolean(R.styleable.CircleProgressBar_mlpb_enable_circle_background, true); mProgress = a.getInt(R.styleable.CircleProgressBar_mlpb_progress, 0); mMax = a.getInt(R.styleable.CircleProgressBar_mlpb_max, 100); int textVisible = a.getInt(R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1); if (textVisible != 1) { mIfDrawText = true; } mTextPaint = new Paint(); mTextPaint.setStyle(Paint.Style.FILL); mTextPaint.setColor(mTextColor); mTextPaint.setTextSize(mTextSize); mTextPaint.setAntiAlias(true); a.recycle(); mProgressDrawable = new MaterialProgressDrawable(getContext(), this); super.setImageDrawable(mProgressDrawable); }
From source file:com.example.ramap.MainActivity.java
private void setUpMapIfNeeded() { if (map == null) { map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); if (map != null) { setUpMap();//from ww w . jav a 2 s.c om //TODO parse from JSON //Keating Hall map.addPolygon(new PolygonOptions() .add(new LatLng(40.86087017518951, -73.88396859169006), new LatLng(40.86056994824036, -73.88344019651413), new LatLng(40.86017843402579, -73.88381570577621), new LatLng(40.86049286272303, -73.88437360525131)) .strokeColor(Color.BLACK).strokeWidth(4).fillColor(Color.GREEN)); //Physics map.addPolygon(new PolygonOptions() .add(new LatLng(40.86065109079324, -73.8857951760292), new LatLng(40.86057197680538, -73.88562351465225), new LatLng(40.86062877660109, -73.88557523488998), new LatLng(40.860541548323354, -73.88539552688599), new LatLng(40.86047866274954, -73.88544380664825), new LatLng(40.8603934628446, -73.88526141643524), new LatLng(40.86024740560974, -73.88539552688599), new LatLng(40.86052329122742, -73.88590782880783)) .strokeColor(Color.BLACK).strokeWidth(4).fillColor(Color.GREEN)); // allows info windows to be clicked on and open OptionsActivity map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWindowClick(final Marker marker) { if (marker.isVisible() //|| marker.getTitle().equals("John Mulcahy Hall") //|| marker.getTitle().equals("Dealy Hall") //|| marker.getTitle().equals("Duane Library") ) { // TODO replace Keating Hall with last marker clicked title // TODO pass marker.getTitle() to --> OptionsActivity --> Info Button, etc. SharedPreferences saveLocation = getSharedPreferences(SAVE, Context.MODE_PRIVATE); SharedPreferences.Editor editor = saveLocation.edit(); editor.putString("name", marker.getTitle()); editor.commit(); //applies the name to XML //Push current checked in location to phone's status bar Notify("Checked Into", marker.getTitle()); Toast.makeText(MainActivity.this, "Location: " + marker.getTitle() + " added to history.", Toast.LENGTH_SHORT) .show(); Intent info = new Intent(MainActivity.this, OptionsActivity.class); // Setup intent to pass marker.getTitle value to OptionsActivity info.putExtra("TO_OPTIONS", marker.getTitle()); // Actually pass the title value based on the marker you clicked in key: TO_OPTIONS to OptionsActivity startActivity(info); // Start OptionsActivity } } }); } } }
From source file:com.demo.wpq.mydemo.customview.progressbar.QLKCircleProgressBar.java
private void init(Context context, AttributeSet attrs, int defStyleAttr) { final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.QLKCircleProgressBar, defStyleAttr, 0);/* ww w . j av a 2 s . c o m*/ // <attr name="mlpb_inner_radius" format="dimension"/> // <attr name="mlpb_background_color" format="color"/> // <attr name="mlpb_progress_color" format="color"/> // <attr name="mlpb_progress_stoke_width" format="dimension"/> // <attr name="mlpb_arrow_width" format="dimension"/> // <attr name="mlpb_arrow_height" format="dimension"/> // // <attr name="mlpb_progress" format="integer"/> // <attr name="mlpb_max" format="integer"/> // // // <attr name="mlpb_progress_text_size" format="dimension"/> // <attr name="mlpb_progress_text_color" format="color"/> // // <attr name="mlpb_progress_text_offset" format="dimension"/> // // <attr name="mlpb_progress_text_visibility" format="enum"> // <enum name="visible" value="0"/> // <enum name="invisible" value="1"/> // </attr> final float density = getContext().getResources().getDisplayMetrics().density; mBackGroundColor = a.getColor(R.styleable.QLKCircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT); mProgressColor = a.getColor(R.styleable.QLKCircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT); mColors = new int[] { mProgressColor }; mInnerRadius = a.getDimensionPixelOffset(R.styleable.QLKCircleProgressBar_mlpb_inner_radius, -1); mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.QLKCircleProgressBar_mlpb_progress_stoke_width, (int) (STROKE_WIDTH_LARGE * density)); mArrowWidth = a.getDimensionPixelOffset(R.styleable.QLKCircleProgressBar_mlpb_arrow_width, -1); mArrowHeight = a.getDimensionPixelOffset(R.styleable.QLKCircleProgressBar_mlpb_arrow_height, -1); mTextSize = a.getDimensionPixelOffset(R.styleable.QLKCircleProgressBar_mlpb_progress_text_size, (int) (DEFAULT_TEXT_SIZE * density)); mTextColor = a.getColor(R.styleable.QLKCircleProgressBar_mlpb_progress_text_color, Color.BLACK); mShowArrow = a.getBoolean(R.styleable.QLKCircleProgressBar_mlpb_show_arrow, false); mCircleBackgroundEnabled = a.getBoolean(R.styleable.QLKCircleProgressBar_mlpb_enable_circle_background, true); mProgress = a.getInt(R.styleable.QLKCircleProgressBar_mlpb_progress, 0); mMax = a.getInt(R.styleable.QLKCircleProgressBar_mlpb_max, 100); int textVisible = a.getInt(R.styleable.QLKCircleProgressBar_mlpb_progress_text_visibility, 1); if (textVisible != 1) { mIfDrawText = true; } mTextPaint = new Paint(); mTextPaint.setStyle(Paint.Style.FILL); mTextPaint.setColor(mTextColor); mTextPaint.setTextSize(mTextSize); mTextPaint.setAntiAlias(true); a.recycle(); mProgressDrawable = new QLKCircleProgressDrawable(getContext(), this); super.setImageDrawable(mProgressDrawable); }
From source file:com.devbrackets.android.exomediademo.test.CircleProgressBar.java
private void init(Context context, AttributeSet attrs, int defStyleAttr) { final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar, defStyleAttr, 0); // <attr name="mlpb_inner_radius" format="dimension"/> // <attr name="mlpb_background_color" format="color"/> // <attr name="mlpb_progress_color" format="color"/> // <attr name="mlpb_progress_stoke_width" format="dimension"/> // <attr name="mlpb_arrow_width" format="dimension"/> // <attr name="mlpb_arrow_height" format="dimension"/> ///*from ww w. ja v a2s . c o m*/ // <attr name="mlpb_progress" format="integer"/> // <attr name="mlpb_max" format="integer"/> // // // <attr name="mlpb_progress_text_size" format="dimension"/> // <attr name="mlpb_progress_text_color" format="color"/> // // <attr name="mlpb_progress_text_offset" format="dimension"/> // // <attr name="mlpb_progress_text_visibility" format="enum"> // <enum name="visible" value="0"/> // <enum name="invisible" value="1"/> // </attr> final float density = getContext().getResources().getDisplayMetrics().density; mBackGroundColor = a.getColor(R.styleable.CircleProgressBar_mlpb_background_color, DEFAULT_CIRCLE_BG_LIGHT); mProgressColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_color, DEFAULT_CIRCLE_BG_LIGHT); mColors = new int[] { Color.rgb(192, 255, 140), Color.rgb(255, 247, 140), Color.rgb(255, 208, 140), Color.rgb(140, 234, 255), Color.WHITE }; mInnerRadius = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_inner_radius, -1); mProgressStokeWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_stoke_width, (int) (STROKE_WIDTH_LARGE * density)); mArrowWidth = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_width, -1); mArrowHeight = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_arrow_height, -1); mTextSize = a.getDimensionPixelOffset(R.styleable.CircleProgressBar_mlpb_progress_text_size, (int) (DEFAULT_TEXT_SIZE * density)); mTextColor = a.getColor(R.styleable.CircleProgressBar_mlpb_progress_text_color, Color.BLACK); mShowArrow = a.getBoolean(R.styleable.CircleProgressBar_mlpb_show_arrow, false); mCircleBackgroundEnabled = a.getBoolean(R.styleable.CircleProgressBar_mlpb_enable_circle_background, false); mProgress = a.getInt(R.styleable.CircleProgressBar_mlpb_progress, 0); mMax = a.getInt(R.styleable.CircleProgressBar_mlpb_max, 100); int textVisible = a.getInt(R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1); if (textVisible != 1) { mIfDrawText = true; } mTextPaint = new Paint(); mTextPaint.setStyle(Paint.Style.FILL); mTextPaint.setColor(mTextColor); mTextPaint.setTextSize(mTextSize); mTextPaint.setAntiAlias(true); a.recycle(); mProgressDrawable = new MaterialProgressDrawable(getContext(), this); super.setImageDrawable(mProgressDrawable); }
From source file:com.nextgis.ngm_clink_monitoring.fragments.StatusBarFragment.java
@Override public void onGpsStatusChanged(int event) { switch (event) { case GpsStatus.GPS_EVENT_SATELLITE_STATUS: GISApplication app = (GISApplication) getActivity().getApplication(); if (app.getCurrentLocation() != null) { mIsGPSFix = (SystemClock.elapsedRealtime() - mLastLocationMillis) < 10000; }/* w ww . j a v a 2s . co m*/ if (!mIsGPSFix) { // The fix has been lost. setLocationDefaultText(); mDistView.setTextColor(Color.BLACK); if (isVisible()) { setLocationViewsText(); } } break; case GpsStatus.GPS_EVENT_FIRST_FIX: mIsGPSFix = true; break; } }
From source file:com.rolmex.android.nemalltone.fragment.ViewPageFragment.java
private void updateTableBg(int position) { switch (position) { case 0://from w w w.ja v a 2 s . c om home_view.setTextColor(context.getResources().getColor(R.color.holo_blue)); always_view.setTextColor(Color.BLACK); break; case 1: home_view.setTextColor(Color.BLACK); always_view.setTextColor(context.getResources().getColor(R.color.holo_blue)); break; default: break; } }
From source file:com.chalmers.schmaps.CheckBusActivity.java
/** * Makes the rows for the chalmerstable//from ww w.ja v a 2 s . c o m */ public void makeChalmersRows() { for (int i = 0; i < NROFROWS; i++) { TableRow tempTableRow = new TableRow(this); tempTableRow.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); // Makes every other row light gray or white if (i % 2 == 0) { tempTableRow.setBackgroundColor(getResources().getColor(R.color.transp_grey)); } else { tempTableRow.setBackgroundColor(getResources().getColor(R.color.transp_white)); } //Makes every textview for each column and add it before starting with a new one for (int j = 0; j < NR_OF_COLUMNS; j++) { TextView textview = new TextView(this); textview.setTextColor(Color.BLACK); textview.setTextSize(TypedValue.COMPLEX_UNIT_SP, TEXT_SIZE); //Check which content should be written in the textview if (j == COLUMN_NR_1) { textview.setText(chalmersLineArray.get(i)); } else if (j == COLUMN_NR_2) { textview.setText(chalmersDestArray.get(i)); } else if (j == COLUMN_NR_3) { textview.setText(chalmersTimeArray.get(i)); } else if (j == COLUMN_NR_4) { textview.setText(chalmersTrackArray.get(i)); } textview.setGravity(Gravity.CENTER_HORIZONTAL); tempTableRow.addView(textview); } chalmersTable.addView(tempTableRow, new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); } }