Code cleanup: add ic_ prefix to icons

This commit is contained in:
Jimmy Shih
2013-07-09 11:53:25 -07:00
parent ae456a498e
commit 1ddb53ad47
67 changed files with 39 additions and 36 deletions
@@ -200,15 +200,15 @@ public class ChartView extends View {
markerPaint.setColor(context.getResources().getColor(android.R.color.darker_gray));
markerPaint.setAntiAlias(false);
pointer = context.getResources().getDrawable(R.drawable.arrow_180);
pointer = context.getResources().getDrawable(R.drawable.ic_arrow_180);
pointer.setBounds(0, 0, pointer.getIntrinsicWidth(), pointer.getIntrinsicHeight());
statisticsMarker = getResources().getDrawable(R.drawable.yellow_pushpin);
statisticsMarker = getResources().getDrawable(R.drawable.ic_marker_yellow_pushpin);
markerWidth = statisticsMarker.getIntrinsicWidth();
markerHeight = statisticsMarker.getIntrinsicHeight();
statisticsMarker.setBounds(0, 0, markerWidth, markerHeight);
waypointMarker = getResources().getDrawable(R.drawable.blue_pushpin);
waypointMarker = getResources().getDrawable(R.drawable.ic_marker_blue_pushpin);
waypointMarker.setBounds(0, 0, markerWidth, markerHeight);
scroller = new Scroller(context);
@@ -252,7 +252,7 @@ public class MapOverlay {
if (cachedLocation.valid) {
MarkerOptions markerOptions = new MarkerOptions().position(cachedLocation.getLatLng())
.anchor(MARKER_X_ANCHOR, MARKER_Y_ANCHOR).draggable(false).visible(true)
.icon(BitmapDescriptorFactory.fromResource(R.drawable.red_dot));
.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_red_paddle));
googleMap.addMarker(markerOptions);
break;
}
@@ -266,7 +266,7 @@ public class MapOverlay {
if (cachedLocation.valid) {
MarkerOptions markerOptions = new MarkerOptions().position(cachedLocation.getLatLng())
.anchor(MARKER_X_ANCHOR, MARKER_Y_ANCHOR).draggable(false).visible(true)
.icon(BitmapDescriptorFactory.fromResource(R.drawable.green_dot));
.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_green_paddle));
googleMap.addMarker(markerOptions);
hasStartMarker = true;
break;
@@ -285,8 +285,8 @@ public class MapOverlay {
for (Waypoint waypoint : waypoints) {
Location location = waypoint.getLocation();
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
int drawableId = waypoint.getType() == WaypointType.STATISTICS ? R.drawable.yellow_pushpin
: R.drawable.blue_pushpin;
int drawableId = waypoint.getType() == WaypointType.STATISTICS
? R.drawable.ic_marker_yellow_pushpin : R.drawable.ic_marker_blue_pushpin;
MarkerOptions markerOptions = new MarkerOptions().position(latLng)
.anchor(WAYPOINT_X_ANCHOR, WAYPOINT_Y_ANCHOR).draggable(false).visible(true)
.icon(BitmapDescriptorFactory.fromResource(drawableId))
@@ -179,7 +179,8 @@ public class MarkerListActivity extends AbstractMyTracksActivity implements Dele
boolean statistics = WaypointType.values()[cursor.getInt(typeIndex)]
== WaypointType.STATISTICS;
int iconId = statistics ? R.drawable.yellow_pushpin : R.drawable.blue_pushpin;
int iconId = statistics ? R.drawable.ic_marker_yellow_pushpin
: R.drawable.ic_marker_blue_pushpin;
String category = statistics ? null : cursor.getString(categoryIndex);
String description = statistics ? null : cursor.getString(descriptionIndex);
ListItemUtils.setListItem(MarkerListActivity.this, view, false, true, iconId,
@@ -483,7 +483,8 @@ public class SearchListActivity extends AbstractSendToGoogleActivity implements
resultMap.put(IS_RECORDING_FIELD, false);
resultMap.put(IS_PAUSED_FIELD, true);
resultMap.put(ICON_ID_FIELD, statistics ? R.drawable.yellow_pushpin : R.drawable.blue_pushpin);
resultMap.put(ICON_ID_FIELD,
statistics ? R.drawable.ic_marker_yellow_pushpin : R.drawable.ic_marker_blue_pushpin);
resultMap.put(ICON_CONTENT_DESCRIPTION_ID_FIELD, R.string.icon_marker);
resultMap.put(NAME_FIELD, waypoint.getName());
resultMap.put(CATEGORY_FIELD, statistics ? null : waypoint.getCategory());
@@ -101,11 +101,12 @@ public class TrackController {
}
recordImageButton.setImageResource(
isRecording && !isPaused ? R.drawable.pause_button : R.drawable.record_button);
isRecording && !isPaused ? R.drawable.button_pause : R.drawable.button_record);
recordImageButton.setContentDescription(activity.getString(
isRecording && !isPaused ? R.string.icon_pause_recording : R.string.icon_record_track));
stopImageButton.setImageResource(isRecording ? R.drawable.stop_1_button : R.drawable.btn_stop_0);
stopImageButton.setImageResource(
isRecording ? R.drawable.button_stop : R.drawable.ic_button_stop_disabled);
stopImageButton.setEnabled(isRecording);
statusTextView.setVisibility(isRecording ? View.VISIBLE : View.INVISIBLE);
@@ -433,7 +433,7 @@ public class TrackWidgetProvider extends AppWidgetProvider {
private static void updateRecordButton(
Context context, RemoteViews remoteViews, boolean isRecording, boolean recordingTrackPaused) {
remoteViews.setImageViewResource(R.id.track_widget_record_button,
isRecording && !recordingTrackPaused ? R.drawable.pause_button : R.drawable.record_button);
isRecording && !recordingTrackPaused ? R.drawable.button_pause : R.drawable.button_record);
int recordActionId;
if (isRecording) {
recordActionId = recordingTrackPaused ? R.string.track_action_resume
@@ -457,8 +457,8 @@ public class TrackWidgetProvider extends AppWidgetProvider {
*/
private static void updateStopButton(
Context context, RemoteViews remoteViews, boolean isRecording) {
remoteViews.setImageViewResource(
R.id.track_widget_stop_button, isRecording ? R.drawable.stop_1_button : R.drawable.btn_stop_0);
remoteViews.setImageViewResource(R.id.track_widget_stop_button,
isRecording ? R.drawable.button_stop : R.drawable.ic_button_stop_disabled);
remoteViews.setBoolean(R.id.track_widget_stop_button, "setEnabled", isRecording);
if (isRecording) {
Intent intent = new Intent(context, ControlRecordingService.class).setAction(