List of usage examples for android.graphics Color MAGENTA
int MAGENTA
To view the source code for android.graphics Color MAGENTA.
Click Source Link
From source file:edu.oakland.festinfo.activities.MapPageActivity.java
@Override protected void onResume() { super.onResume(); combinedArray.clear();// w w w .j a v a 2 s .com int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); if (resultCode == ConnectionResult.SUCCESS) { //Toast.makeText(getApplicationContext(), "isGooglePlayServicesAvailable SUCCESS", Toast.LENGTH_LONG).show(); } else { GooglePlayServicesUtil.getErrorDialog(resultCode, this, RQS_GooglePlayServices); } ParseUser currentUser = ParseUser.getCurrentUser(); ParseGeoPoint currentLocation = currentUser.getParseGeoPoint("currentLocation"); if (currentLocation.getLatitude() != 0 || currentLocation.getLongitude() != 0) { fabOn.setVisibility(View.INVISIBLE); fabOff.setVisibility(View.VISIBLE); } else { fabOn.setVisibility(View.VISIBLE); fabOff.setVisibility(View.INVISIBLE); } //Pregenerated Markers for Geofences Marker m1 = map .addMarker(new MarkerOptions().title("Ranch Area").position(new LatLng(42.671896, -83.215000)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))); Marker m2 = map .addMarker(new MarkerOptions().title("Sherwood Court").position(new LatLng(42.670989, -83.217028)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))); Marker m3 = map.addMarker(new MarkerOptions().title("Tripolee").position(new LatLng(42.673979, -83.212962)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))); Marker m4 = map .addMarker(new MarkerOptions().title("The Hangar").position(new LatLng(42.674286, -83.216577)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))); Marker m5 = map.addMarker(new MarkerOptions().title("Jubilee").position(new LatLng(42.672042, -83.213621)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))); Marker m6 = map .addMarker(new MarkerOptions().title("Forest Stage").position(new LatLng(42.677103, -83.213855)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))); Marker m7 = map .addMarker(new MarkerOptions().title("The Observatory").position(new LatLng(42.677953, -83.219222)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))); //Build predefined Circles //Ranch Area Circle c1 = map.addCircle(new CircleOptions().center(new LatLng(42.671896, -83.215000)).radius(60) .strokeColor(Color.MAGENTA).strokeWidth(3)); //Sherwood Court Circle c2 = map.addCircle(new CircleOptions().center(new LatLng(42.670989, -83.217028)).radius(100) .strokeColor(Color.MAGENTA).strokeWidth(3)); //Tripolee Circle c3 = map.addCircle(new CircleOptions().center(new LatLng(42.673979, -83.212962)).radius(100) .strokeColor(Color.MAGENTA).strokeWidth(3)); //The Hangar Circle c4 = map.addCircle(new CircleOptions().center(new LatLng(42.674286, -83.216577)).radius(100) .strokeColor(Color.MAGENTA).strokeWidth(3)); //Jubilee Circle c5 = map.addCircle(new CircleOptions().center(new LatLng(42.672042, -83.213621)).radius(50) .strokeColor(Color.MAGENTA).strokeWidth(3)); //Forest Stage Circle c6 = map.addCircle(new CircleOptions().center(new LatLng(42.677103, -83.213855)).radius(100) .strokeColor(Color.MAGENTA).strokeWidth(3)); //The Observatory Circle c7 = map.addCircle(new CircleOptions().center(new LatLng(42.677953, -83.219222)).radius(100) .strokeColor(Color.MAGENTA).strokeWidth(3)); combinedArray.add(new CombinedMarker(m1, c1, m1.getId(), "stage")); combinedArray.add(new CombinedMarker(m2, c2, m2.getId(), "stage")); combinedArray.add(new CombinedMarker(m3, c3, m3.getId(), "stage")); combinedArray.add(new CombinedMarker(m4, c4, m4.getId(), "stage")); combinedArray.add(new CombinedMarker(m5, c5, m5.getId(), "stage")); combinedArray.add(new CombinedMarker(m6, c6, m6.getId(), "stage")); combinedArray.add(new CombinedMarker(m7, c7, m7.getId(), "stage")); //Build static geofences here if (geofencesCreated == false) { //Ranch Area geofenceArray.add(new Geofence.Builder().setRequestId("RanchArea").setLoiteringDelay(20000) .setExpirationDuration(Geofence.NEVER_EXPIRE).setCircularRegion(42.671896, -83.215000, 60) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); //Sherwood Court geofenceArray.add(new Geofence.Builder().setRequestId("SherwoodCourt").setLoiteringDelay(20000) .setExpirationDuration(Geofence.NEVER_EXPIRE).setCircularRegion(42.670989, -83.217028, 100) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); //Tripolee geofenceArray.add(new Geofence.Builder().setRequestId("Tripolee").setLoiteringDelay(20000) .setExpirationDuration(Geofence.NEVER_EXPIRE).setCircularRegion(42.673979, -83.212962, 100) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); //The Hangar geofenceArray.add(new Geofence.Builder().setRequestId("TheHangar").setLoiteringDelay(20000) .setExpirationDuration(Geofence.NEVER_EXPIRE).setCircularRegion(42.674286, -83.216577, 100) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); //Jubilee geofenceArray.add(new Geofence.Builder().setRequestId("Jubilee").setLoiteringDelay(20000) .setExpirationDuration(Geofence.NEVER_EXPIRE).setCircularRegion(42.672042, -83.213621, 100) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); //Forest Stage geofenceArray.add(new Geofence.Builder().setRequestId("ForestStage").setLoiteringDelay(20000) .setExpirationDuration(Geofence.NEVER_EXPIRE).setCircularRegion(42.677103, -83.213855, 100) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); //The Observatory geofenceArray.add(new Geofence.Builder().setRequestId("TheObservatory").setLoiteringDelay(20000) .setExpirationDuration(Geofence.NEVER_EXPIRE).setCircularRegion(42.677953, -83.219222, 100) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); mGeofenceStore = new GeofenceStore(MapPageActivity.this, geofenceArray); geofencesCreated = true; } ParseQuery markerQuery = new ParseQuery("MapMarkers"); markerQuery.findInBackground(new FindCallback<ParseObject>() { public void done(List<ParseObject> objects, ParseException e) { if (e == null) { for (int i = 0; i < objects.size(); i++) { titleGet = objects.get(i).getString("Title"); geo1Lat = objects.get(i).getParseGeoPoint("Location").getLatitude(); geo1Long = objects.get(i).getParseGeoPoint("Location").getLongitude(); markerHue = objects.get(i).getNumber("Color").floatValue(); checkHasCircle = objects.get(i).getBoolean("HasGeofence"); geofenceID = objects.get(i).getString("GeofenceID"); geofenceRadius = objects.get(i).getDouble("GeofenceRadius"); Marker marker = map.addMarker( new MarkerOptions().position(new LatLng(geo1Lat, geo1Long)).title(titleGet) .draggable(true).icon(BitmapDescriptorFactory.defaultMarker(markerHue))); Circle circle = mapCircle = map.addCircle( new CircleOptions().center(new LatLng(geo1Lat, geo1Long)).radius(geofenceRadius)); int baseColor = Color.RED; mapCircle.setStrokeColor(baseColor); mapCircle.setStrokeWidth(2); if (markerHue == BitmapDescriptorFactory.HUE_RED) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "first aid"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_AZURE) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "lost found"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_ORANGE) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "food"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_GREEN) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "shuttle"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_VIOLET) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "atm"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_MAGENTA) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "stage"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_ROSE) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "hot air"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_BLUE) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "hammock"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_CYAN) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "tents"); combinedArray.add(combined); } else if (markerHue == BitmapDescriptorFactory.HUE_YELLOW) { CombinedMarker combined = new CombinedMarker(marker, circle, marker.getId(), "restrooms"); combinedArray.add(combined); } if (!stageSelected.isEmpty()) { centerMapOnMarker(); } //Code to build the geofences /*if (geofencesCreated = false) { geofenceArray.add(new Geofence.Builder() .setRequestId(geofenceID) .setCircularRegion(geo1Lat, geo1Long, Float.valueOf(String.valueOf(geofenceRadius))) .setExpirationDuration(Geofence.NEVER_EXPIRE) .setLoiteringDelay(30000) .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER | Geofence.GEOFENCE_TRANSITION_DWELL | Geofence.GEOFENCE_TRANSITION_EXIT) .build()); LocationServices.GeofencingApi.addGeofences( mGoogleApiClient, getGeofencingRequest(fence), getGeofencePendingIntent() ).setResultCallback(MapPageActivity.this); } */ } } else { Toast.makeText(getApplicationContext(), "Error!", Toast.LENGTH_SHORT).show(); } } }); mapKeySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { switch (position) { case 0: for (int i = 0; i < combinedArray.size(); i++) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } break; case 1: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("food")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 2: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("first aid")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 3: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("hammock")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 4: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("atm")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 5: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("lost found")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 6: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("hot air")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 7: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("shuttle")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 8: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("restrooms")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 9: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("tents")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; case 10: for (int i = 0; i < combinedArray.size(); i++) { if (combinedArray.get(i).getMarkerType().equals("stage")) { combinedArray.get(i).getMarker().setVisible(true); combinedArray.get(i).getCircle().setVisible(true); } else { combinedArray.get(i).getMarker().setVisible(false); combinedArray.get(i).getCircle().setVisible(false); } } break; } } public void onNothingSelected(AdapterView<?> parent) { // Another interface callback } }); if (!friendToNavigateTo.isEmpty()) { navigateToFriend(friendToNavigateTo); } }
From source file:com.bizcom.vc.widget.cus.SubsamplingScaleImageView.java
/** * Creates Paint objects once when first needed. *///from ww w.j a v a2s. com private void createPaints() { if (bitmapPaint == null) { bitmapPaint = new Paint(); bitmapPaint.setAntiAlias(true); bitmapPaint.setFilterBitmap(true); bitmapPaint.setDither(true); } if (debugPaint == null && debug) { debugPaint = new Paint(); debugPaint.setTextSize(18); debugPaint.setColor(Color.MAGENTA); debugPaint.setStyle(Style.STROKE); } }
From source file:org.brandroid.openmanager.activities.OpenExplorer.java
private void setupLoggingDb() { FTP.setCommunicationListener(new OnFTPCommunicationListener() { @Override//from ww w. j av a 2s .c o m public void onDisconnect(FTP file) { sendToLogView("FTP Disconnect " + getFTPString(file), Color.GRAY); } @Override public void onConnectFailure(FTP file) { sendToLogView("FTP Failure " + getFTPString(file), Color.RED); } @Override public void onConnect(FTP file) { sendToLogView("FTP Connect " + getFTPString(file), Color.GREEN); } @Override public void onBeforeConnect(FTP file) { //sendToLogView("FTP Before Connect " + getFTPString(file)); } @Override public void onSendCommand(FTP file, String message) { if (message.startsWith("PASS ")) message = "PASS " + message.substring(6).replaceAll(".", "*"); sendToLogView("Command: " + message.replace("\n", ""), Color.BLACK); // + getFTPString(file), Color.BLACK); } private String getFTPString(FTP file) { if (file != null && file.getSocket() != null && file.getRemoteAddress() != null) return " @ " + file.getRemoteAddress().getHostName(); return ""; } @Override public void onReply(String line) { sendToLogView("Reply: " + line, Color.BLUE); } }); JSch.setLogger(new com.jcraft.jsch.Logger() { @Override public void log(int level, String message) { switch (level) { case com.jcraft.jsch.Logger.DEBUG: sendToLogView("SFTP - " + message, Color.GREEN); break; case com.jcraft.jsch.Logger.INFO: sendToLogView("SFTP - " + message, Color.BLUE); break; case com.jcraft.jsch.Logger.WARN: sendToLogView("SFTP - " + message, Color.YELLOW); break; case com.jcraft.jsch.Logger.ERROR: sendToLogView("SFTP - " + message, Color.RED); break; case com.jcraft.jsch.Logger.FATAL: sendToLogView("SFTP - " + message, Color.MAGENTA); break; default: sendToLogView("SFTP (" + level + ") - " + message, Color.BLACK); break; } } @Override public boolean isEnabled(int level) { return true; } }); if (Logger.isLoggingEnabled()) { if (getPreferences().getBoolean("global", "pref_stats", true)) { if (!Logger.hasDb()) Logger.setDb(new LoggerDbAdapter(getApplicationContext())); } else if (!IS_DEBUG_BUILD) Logger.setLoggingEnabled(false); } SmbFile.setSMBCommunicationListener(new OnSMBCommunicationListener() { @Override public void onBeforeConnect(SmbFile file) { sendToLogView("SMB Connecting: " + file.getPath(), Color.GREEN); } @Override public void onConnect(SmbFile file) { //sendToLogView("SMB Connected: " + file.getPath(), Color.GREEN); } @Override public void onConnectFailure(SmbFile file) { sendToLogView("SMB Connect Failure: " + file.getPath(), Color.RED); } @Override public void onDisconnect(SmbFile file) { sendToLogView("SMB Disconnect: " + file.getPath(), Color.DKGRAY); } @Override public void onSendCommand(SmbFile file, Object... commands) { URL url = file.getURL(); String s = "Command: smb://" + url.getHost() + url.getPath(); for (Object o : commands) { if (o instanceof ServerMessageBlock) { ServerMessageBlock blk = (ServerMessageBlock) o; String tmp = blk.toString(); if (tmp.indexOf("[") > -1) s += " -> " + tmp.substring(0, tmp.indexOf("[")); else s += " -> " + tmp; } else s += " -> " + o.toString(); } sendToLogView(s, Color.BLACK); } }); }
From source file:com.android.systemui.statusbar.phone.NotificationPanelView.java
@Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); if (DEBUG) {//from ww w.j a v a2 s. com Paint p = new Paint(); p.setColor(Color.RED); p.setStrokeWidth(2); p.setStyle(Paint.Style.STROKE); canvas.drawLine(0, getMaxPanelHeight(), getWidth(), getMaxPanelHeight(), p); p.setColor(Color.BLUE); canvas.drawLine(0, getExpandedHeight(), getWidth(), getExpandedHeight(), p); p.setColor(Color.GREEN); canvas.drawLine(0, calculatePanelHeightQsExpanded(), getWidth(), calculatePanelHeightQsExpanded(), p); p.setColor(Color.YELLOW); canvas.drawLine(0, calculatePanelHeightShade(), getWidth(), calculatePanelHeightShade(), p); p.setColor(Color.MAGENTA); canvas.drawLine(0, calculateQsTopPadding(), getWidth(), calculateQsTopPadding(), p); p.setColor(Color.CYAN); canvas.drawLine(0, mNotificationStackScroller.getTopPadding(), getWidth(), mNotificationStackScroller.getTopPadding(), p); } }