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:edu.pitt.gis.uniapp.UniApp.java
/** * Shows the splash screen over the full Activity *//*from www . j ava 2 s .c o m*/ @SuppressWarnings("deprecation") protected void showSplashScreen(final int time) { final UniApp that = this; Runnable runnable = new Runnable() { public void run() { // Get reference to display Display display = getWindowManager().getDefaultDisplay(); // Create the layout for the dialog LinearLayout root = new LinearLayout(that.getActivity()); root.setMinimumHeight(display.getHeight()); root.setMinimumWidth(display.getWidth()); root.setOrientation(LinearLayout.VERTICAL); root.setBackgroundColor(that.getIntegerProperty("backgroundColor", Color.BLACK)); root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.0F)); root.setBackgroundResource(that.splashscreen); // Create and show the dialog splashDialog = new Dialog(that, android.R.style.Theme_Translucent_NoTitleBar); // check to see if the splash screen should be full screen if ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == WindowManager.LayoutParams.FLAG_FULLSCREEN) { splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } splashDialog.setContentView(root); splashDialog.setCancelable(false); splashDialog.show(); // Set Runnable to remove splash screen just in case final Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { removeSplashScreen(); } }, time); } }; this.runOnUiThread(runnable); }
From source file:com.makotojava.android.debate.PolicySpeechFragment.java
private void createCrossExTimerOnLongClickListener(TextView speechTimer) { speechTimer.setOnLongClickListener(new OnLongClickListener() { @Override/* w ww . j av a 2 s .co m*/ public boolean onLongClick(View v) { getActivity().startActionMode(new ActionMode.Callback() { @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { // Nothing to do } @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { // Inflate the menu MenuInflater inflater = mode.getMenuInflater(); inflater.inflate(R.menu.crossex_timer_context_menu, menu); return true; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { boolean ret = false; switch (item.getItemId()) { case R.id.crossex_context_menu_reset: Log.i(TAG, "CONTEXT MENU: CrossEx Timer **RESET**"); long originalDurationInMillis = _crossexTimer.reset(); updateTimerTextView(_crossexTimerTextView, originalDurationInMillis); _crossexTimerTextView.setTextColor(Color.BLACK); mode.finish(); ret = true; break; case R.id.crossex_context_menu_set: Log.i(TAG, "CONTEXT MENU: CrossEx Timer **SET**"); // Display dialog to set Timer FragmentManager fragMan = getActivity().getFragmentManager(); TimePickerFragment dialog = TimePickerFragment.newInstance( _crossexTimer.getMillisUntilFinished(), _speech.getCrossExDurationInMinutes(), RQID_CROSSEXTIMER); dialog.setTargetFragment(PolicySpeechFragment.this, 0); dialog.show(fragMan, MINUTES_SECONDS_PICKER_TITLE); _crossexTimerTextView.setTextColor(Color.BLACK); mode.finish(); ret = true; break; } return ret; } }); return true; } }); }
From source file:net.droidsolutions.droidcharts.core.plot.XYPlot.java
/** * Creates a new plot with the specified dataset, axes and renderer. Any of * the arguments can be <code>null</code>, but in that case you should take * care to specify the value before using the plot (otherwise a * <code>NullPointerException</code> may be thrown). * //from w w w . ja va2 s. c o m * @param dataset * the dataset (<code>null</code> permitted). * @param domainAxis * the domain axis (<code>null</code> permitted). * @param rangeAxis * the range axis (<code>null</code> permitted). * @param renderer * the renderer (<code>null</code> permitted). */ public XYPlot(XYDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, XYItemRenderer renderer) { super(); this.orientation = PlotOrientation.VERTICAL; this.weight = 1; // only relevant when this is a subplot this.axisOffset = RectangleInsets.ZERO_INSETS; // allocate storage for datasets, axes and renderers (all optional) this.domainAxes = new ObjectList(); this.domainAxisLocations = new ObjectList(); this.foregroundDomainMarkers = new HashMap(); this.backgroundDomainMarkers = new HashMap(); this.rangeAxes = new ObjectList(); this.rangeAxisLocations = new ObjectList(); this.foregroundRangeMarkers = new HashMap(); this.backgroundRangeMarkers = new HashMap(); this.datasets = new ObjectList(); this.renderers = new ObjectList(); this.datasetToDomainAxesMap = new TreeMap(); this.datasetToRangeAxesMap = new TreeMap(); this.annotations = new java.util.ArrayList(); this.datasets.set(0, dataset); if (dataset != null) { // dataset.addChangeListener(this); } this.renderers.set(0, renderer); if (renderer != null) { renderer.setPlot(this); renderer.addChangeListener(this); } this.domainAxes.set(0, domainAxis); this.mapDatasetToDomainAxis(0, 0); if (domainAxis != null) { domainAxis.setPlot(this); // domainAxis.addChangeListener(this); } this.domainAxisLocations.set(0, AxisLocation.BOTTOM_OR_LEFT); this.rangeAxes.set(0, rangeAxis); this.mapDatasetToRangeAxis(0, 0); if (rangeAxis != null) { rangeAxis.setPlot(this); // rangeAxis.addChangeListener(this); } this.rangeAxisLocations.set(0, AxisLocation.BOTTOM_OR_LEFT); configureDomainAxes(); configureRangeAxes(); Paint white = new Paint(Paint.ANTI_ALIAS_FLAG); white.setColor(Color.WHITE); Paint black = new Paint(Paint.ANTI_ALIAS_FLAG); white.setColor(Color.BLACK); this.domainGridlinesVisible = true; this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE; this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT; this.domainMinorGridlinesVisible = false; this.domainMinorGridlineStroke = DEFAULT_GRIDLINE_STROKE; this.domainMinorGridlinePaint = white; this.domainZeroBaselineVisible = false; this.domainZeroBaselinePaint = black; this.domainZeroBaselineStroke = 1f; this.rangeGridlinesVisible = true; this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE; this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT; this.rangeMinorGridlinesVisible = false; this.rangeMinorGridlineStroke = DEFAULT_GRIDLINE_STROKE; this.rangeMinorGridlinePaint = white; this.rangeZeroBaselineVisible = false; this.rangeZeroBaselinePaint = black; this.rangeZeroBaselineStroke = 1f; this.domainCrosshairVisible = false; this.domainCrosshairValue = 0.0; this.domainCrosshairStroke = DEFAULT_CROSSHAIR_STROKE; this.domainCrosshairPaint = DEFAULT_CROSSHAIR_PAINT; this.rangeCrosshairVisible = false; this.rangeCrosshairValue = 0.0; this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE; this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT; }
From source file:com.example.psumaps.MapView.java
private void drawMarker(LatLng point, String str) { // Creating an instance of MarkerOptions MarkerOptions markerOptions = new MarkerOptions(); //IconGenerator tc = new IconGenerator(this); //Bitmap bmp = tc.makeIcon("hello"); Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.bubble_white);// get the image same as your EditText int h = bitmap.getHeight() * 2; int w = bitmap.getWidth() * 2; bitmap = convertToMutable(bitmap);// converting the bitmap to mutable Bitmap incrsize = Bitmap.createScaledBitmap(bitmap, w, h, false); Canvas cs = new Canvas(incrsize); Paint pt = new Paint(); pt.setColor(Color.BLACK); //Typeface tf = Typeface.create("Helvetica",Typeface.BOLD); pt.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); String iam = str.toUpperCase(Locale.getDefault()); pt.setTextSize(25);//from w ww . j a v a 2 s . c o m cs.drawText(iam, 0, iam.length(), (h / 2) + 10, (w / 2) / 2, pt); //pt.setColor(Color.RED); //cs.drawText("this is praki", 0, 13, h / 2, w / 3, pt); // Setting latitude and longitude for the marker markerOptions.position(point).title(str).icon(BitmapDescriptorFactory.fromBitmap(incrsize)); // Adding marker on the Google Map map.addMarker(markerOptions); }
From source file:com.mjhram.ttaxi.GpsMainActivity.java
@EventBusHook public void onEventMainThread(ServiceEvents.updateDrivers updateDriversEvent) { tracer.debug("updating nearby driver"); double[] drvLat = updateDriversEvent.drvLat; double[] drvLong = updateDriversEvent.drvLong; double lat_dw = updateDriversEvent.lat_d; double lng_dw = updateDriversEvent.lng_d; Location loc = updateDriversEvent.location; LatLng center = new LatLng(loc.getLatitude(), loc.getLongitude()); //double radiusInMeters = Utilities.toRadiusMeters(new LatLng(0.0, 0.0), new LatLng(radius, radius)); //1. remove previous markers clearDriversMarkers();// w ww.j a v a2 s . c o m //2.a add scan circle int circleStrokeWidth = 3; int mStrokeColor = Color.BLACK; int mFillColor1 = 20; int mAlpha = 20; int mFillColor = Color.HSVToColor(mAlpha, new float[] { mFillColor1, 1, 1 }); /*CircleOptions opt = new CircleOptions() .center(center) .radius(radiusInMeters) .strokeWidth(circleStrokeWidth) .strokeColor(mStrokeColor) .fillColor(mFillColor); mapsSearchCircle = googleMap.addCircle(opt);*/ //Polygon [or rectangle] PolygonOptions options = new PolygonOptions().addAll(Utilities.createRectangle(center, lat_dw, lng_dw)); searchPolygon = googleMap .addPolygon(options.strokeWidth(circleStrokeWidth).strokeColor(Color.BLACK).fillColor(mFillColor)); //2.b add new markers countOfDrivers = updateDriversEvent.drvCount; nearbyDrivers = new Marker[countOfDrivers]; for (int i = 0; i < updateDriversEvent.drvCount; i++) { LatLng driverPosition = new LatLng(drvLat[i], drvLong[i]); MarkerOptions markerOptions = new MarkerOptions().position(driverPosition) .icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi)).anchor(0.5f, 0.5f).draggable(true); ; nearbyDrivers[i] = googleMap.addMarker(markerOptions); } }
From source file:com.offers.couponempire.ui.BaseActivity.java
protected void onActionBarAutoShowOrHide(boolean shown) { if (mStatusBarColorAnimator != null) { mStatusBarColorAnimator.cancel(); }//from w ww. jav a2 s . co m mStatusBarColorAnimator = ObjectAnimator .ofInt((mDrawerLayout != null) ? mDrawerLayout : mLPreviewUtils, (mDrawerLayout != null) ? "statusBarBackgroundColor" : "statusBarColor", shown ? Color.BLACK : mNormalStatusBarColor, shown ? mNormalStatusBarColor : Color.BLACK) .setDuration(250); if (mDrawerLayout != null) { mStatusBarColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { ViewCompat.postInvalidateOnAnimation(mDrawerLayout); } }); } mStatusBarColorAnimator.setEvaluator(ARGB_EVALUATOR); mStatusBarColorAnimator.start(); for (View view : mHideableHeaderViews) { if (shown) { view.animate().translationY(0).alpha(1).setDuration(HEADER_HIDE_ANIM_DURATION) .setInterpolator(new DecelerateInterpolator()); } else { view.animate().translationY(-view.getBottom()).alpha(0).setDuration(HEADER_HIDE_ANIM_DURATION) .setInterpolator(new DecelerateInterpolator()); } } }
From source file:com.makotojava.android.debate.PolicySpeechFragment.java
private void createAffPrepTimerOnLongClickListener(TextView speechTimer) { speechTimer.setOnLongClickListener(new OnLongClickListener() { @Override/*from w ww. j a v a 2s . c o m*/ public boolean onLongClick(View v) { getActivity().startActionMode(new ActionMode.Callback() { @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { // Nothing to do } @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { // Inflate the menu MenuInflater inflater = mode.getMenuInflater(); inflater.inflate(R.menu.affprep_timer_context_menu, menu); return true; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { boolean ret = false; switch (item.getItemId()) { case R.id.affprep_context_menu_reset: Log.i(TAG, "CONTEXT MENU: Aff Prep Timer **RESET**"); long originalDurationInMillis = getAffirmativePrepTimer().reset(); updateTimerTextView(_affirmativePrepTimerTextView, originalDurationInMillis); getPolicySpeechSingleton().setAffirmativePrepRemainingTime(originalDurationInMillis); _affirmativePrepTimerTextView.setTextColor(Color.BLACK); ret = true; break; case R.id.affprep_context_menu_set: Log.i(TAG, "CONTEXT MENU: Aff Prep Timer **SET**"); // Display dialog to set Timer FragmentManager fragMan = getActivity().getFragmentManager(); TimePickerFragment dialog = TimePickerFragment.newInstance( getAffirmativePrepTimer().getMillisUntilFinished(), PolicySpeechFactory.PREP_TIME_IN_MINUTES, RQID_AFFPREPTIMER); dialog.setTargetFragment(PolicySpeechFragment.this, 0); dialog.show(fragMan, MINUTES_SECONDS_PICKER_TITLE); _affirmativePrepTimerTextView.setTextColor(Color.BLACK); ret = true; break; } return ret; } }); return true; } }); }
From source file:terse.a1.TerseActivity.java
private void postMortem(Throwable ex) { String explain = Static.describe(ex); TextView explainv = new TextView(this); explainv.setText(explain);//from www. j a va 2 s .co m explainv.setBackgroundColor(Color.BLACK); explainv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24); explainv.setTextColor(Color.RED); SetContentViewWithHomeButtonAndScroll(explainv); }
From source file:com.daiv.android.twitter.ui.drawer_activities.DrawerActivity.java
public void setUpTheme() { actionBar = getActionBar();/*from ww w. ja va 2 s . c o m*/ if (!getResources().getBoolean(R.bool.isTablet)) { actionBar.setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent))); } else { actionBar.setIcon(R.mipmap.ic_launcher); } if (Build.VERSION.SDK_INT > 18 && settings.uiExtras && (getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE || getResources().getBoolean(R.bool.isTablet)) && !MainActivity.isPopup) { translucent = true; getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); try { int immersive = android.provider.Settings.System.getInt(getContentResolver(), "immersive_mode"); if (immersive == 1) { translucent = false; } } catch (Exception e) { } } else { translucent = false; } Utils.setUpTheme(context, settings); /*if (settings.addonTheme) { getWindow().getDecorView().setBackgroundColor(settings.backgroundColor); } else { TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{R.attr.windowBackground}); int resource = a.getResourceId(0, 0); a.recycle(); getWindow().getDecorView().setBackgroundResource(resource); }*/ // this is a super hacky workaround for the theme problems that some people were having... but it works ok int actionBarTitleId = 0; TextView title = null; try { actionBarTitleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android"); } catch (Exception e) { // just in case } if (actionBarTitleId > 0) { title = (TextView) findViewById(actionBarTitleId); } switch (settings.theme) { case AppSettings.THEME_LIGHT: getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_solid_light_holo)); if (title != null) { title.setTextColor(Color.BLACK); } break; case AppSettings.THEME_DARK: getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_solid_dark)); if (title != null) { title.setTextColor(Color.WHITE); } break; case AppSettings.THEME_BLACK: getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_solid_black)); if (title != null) { title.setTextColor(Color.WHITE); } break; } Utils.setActionBar(context, true); }
From source file:com.example.administrator.testscreenrecording.control.StreamingCamera2Fragment.java
@Override public void onClick(View view) { switch (view.getId()) { /* case R.id.picture: { takePicture();// w w w . j a va 2s . c o m break; }*/ case R.id.streaming: { if (!recording) { startRecording(); recordButton.setText("Stop"); recordButton.setTextColor(Color.RED); Snackbar.make(root, "Start streaming...", Snackbar.LENGTH_LONG).show(); } else { stopRecording(); recordButton.setText("Start"); recordButton.setTextColor(Color.BLACK); Snackbar.make(root, "Stop streaming...", Snackbar.LENGTH_LONG).show(); } break; } } }