Codeclean: accessibility content description

This commit is contained in:
Jimmy Shih
2014-01-13 14:25:33 -08:00
parent f43d2ab766
commit 2f64785a63
20 changed files with 77 additions and 59 deletions
@@ -29,7 +29,7 @@ limitations under the License.
android:layout_width="match_parent" />
<ImageButton
android:background="@android:color/transparent"
android:contentDescription="@string/icon_record_track"
android:contentDescription="@string/image_record"
android:id="@+id/track_controller_record"
android:layout_height="0dp"
android:layout_weight="10"
@@ -56,7 +56,7 @@ limitations under the License.
</RelativeLayout>
<ImageButton
android:background="@android:color/transparent"
android:contentDescription="@string/icon_stop_recording"
android:contentDescription="@string/image_stop"
android:id="@+id/track_controller_stop"
android:layout_height="0dp"
android:layout_weight="10"
+4 -2
View File
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:baselineAligned="false"
android:layout_height="match_parent"
android:layout_width="match_parent" >
<include layout="@layout/track_controller" />
@@ -41,6 +42,7 @@ limitations under the License.
android:layout_weight="1"
android:layout_width="match_parent" />
<ImageView
android:contentDescription="@string/image_arrow"
android:layout_height="0dp"
android:layout_weight="10"
android:layout_width="wrap_content"
@@ -52,10 +54,10 @@ limitations under the License.
</LinearLayout>
<LinearLayout
android:layout_height="match_parent"
android:paddingRight="20dp"
android:layout_toRightOf="@id/track_list_arrow_long"
android:layout_width="wrap_content"
android:orientation="vertical" >
android:orientation="vertical"
android:paddingRight="20dp" >
<View
android:layout_height="0dp"
android:layout_weight="4"
@@ -22,7 +22,7 @@ limitations under the License.
android:paddingLeft="16dp"
android:paddingRight="16dp" >
<ImageView
android:contentDescription="@string/icon_application"
android:contentDescription="@string/image_application"
android:id="@+id/choose_activity_list_item_icon"
android:layout_height="@android:dimen/app_icon_size"
android:layout_width="@android:dimen/app_icon_size"
+4 -4
View File
@@ -19,7 +19,7 @@ limitations under the License.
android:layout_width="match_parent" >
<!-- Photo -->
<ImageView
android:contentDescription="@string/icon_marker"
android:contentDescription="@string/image_photo_marker"
android:id="@+id/list_item_photo"
android:layout_height="match_parent"
android:layout_width="match_parent"
@@ -31,7 +31,7 @@ limitations under the License.
<!-- A gradient on top of the text -->
<ImageView
android:alpha=".6"
android:contentDescription="@string/icon_marker"
android:contentDescription="@string/image_photo_marker"
android:id="@+id/list_item_text_gradient"
android:layout_height="match_parent"
android:layout_width="match_parent"
@@ -50,7 +50,7 @@ limitations under the License.
<TableRow>
<!-- Table 1: Row 1: Column 1: (icon) -->
<ImageView
android:contentDescription="@string/icon_track"
android:contentDescription="@string/image_track"
android:id="@+id/list_item_icon"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
@@ -91,7 +91,7 @@ limitations under the License.
android:singleLine="true"
style="@style/TextSmall" />
<ImageView
android:contentDescription="@string/icon_marker"
android:contentDescription="@string/image_marker_count"
android:id="@+id/list_item_marker_count_icon"
android:layout_gravity="bottom"
android:layout_height="wrap_content"
+1 -1
View File
@@ -31,7 +31,7 @@ limitations under the License.
style="@style/TextMedium.WithIcon" />
<ImageButton
android:background="@drawable/my_location"
android:contentDescription="@string/icon_my_location"
android:contentDescription="@string/image_my_location"
android:id="@+id/map_my_location"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
@@ -23,7 +23,7 @@ limitations under the License.
android:layout_width="match_parent" >
<ImageView
android:background="@android:color/black"
android:contentDescription="@string/icon_marker"
android:contentDescription="@string/image_photo_marker"
android:id="@+id/marker_detail_waypoint_photo"
android:layout_height="match_parent"
android:layout_width="match_parent"
@@ -34,7 +34,7 @@ limitations under the License.
<!-- A gradient on top of the text -->
<ImageView
android:alpha=".6"
android:contentDescription="@string/icon_marker"
android:contentDescription="@string/image_photo_marker"
android:id="@+id/marker_detail_waypoint_text_gradient"
android:layout_height="match_parent"
android:layout_width="match_parent"
+2 -2
View File
@@ -28,7 +28,7 @@ limitations under the License.
android:layout_width="0dp" />
<ImageButton
android:background="@android:color/transparent"
android:contentDescription="@string/icon_record_track"
android:contentDescription="@string/image_record"
android:id="@+id/track_controller_record"
android:layout_height="wrap_content"
android:layout_weight="10"
@@ -56,7 +56,7 @@ limitations under the License.
</RelativeLayout>
<ImageButton
android:background="@android:color/transparent"
android:contentDescription="@string/icon_stop_recording"
android:contentDescription="@string/image_stop"
android:id="@+id/track_controller_stop"
android:layout_height="wrap_content"
android:layout_weight="10"
+1
View File
@@ -40,6 +40,7 @@ limitations under the License.
android:layout_weight="1"
android:layout_width="0dp" />
<ImageView
android:contentDescription="@string/image_arrow"
android:layout_height="wrap_content"
android:layout_weight="10"
android:layout_width="0dp"
+3 -3
View File
@@ -26,7 +26,7 @@ limitations under the License.
android:layout_weight="1"
style="@style/TrackWidgetVerticalSpacer" />
<ImageButton
android:contentDescription="@string/icon_record_track"
android:contentDescription="@string/image_record"
android:id="@+id/track_widget_record_button"
android:src="@drawable/button_record"
style="@style/TrackWidgetButton" />
@@ -91,7 +91,7 @@ limitations under the License.
</LinearLayout>
</LinearLayout>
<ImageButton
android:contentDescription="@string/icon_stop_recording"
android:contentDescription="@string/image_stop"
android:id="@+id/track_widget_stop_button"
android:src="@drawable/ic_button_stop_disabled"
style="@style/TrackWidgetButton" />
@@ -100,6 +100,6 @@ limitations under the License.
style="@style/TrackWidgetVerticalSpacer" />
</LinearLayout>
<ImageView
android:contentDescription="@string/my_tracks_app_name"
android:contentDescription="@string/image_my_tracks_logo"
style="@style/TrackWidgetLogo" />
</RelativeLayout>
+3 -3
View File
@@ -138,7 +138,7 @@ limitations under the License.
android:layout_weight="1"
style="@style/TrackWidgetVerticalSpacer" />
<ImageButton
android:contentDescription="@string/icon_record_track"
android:contentDescription="@string/image_record"
android:id="@+id/track_widget_record_button"
android:src="@drawable/button_record"
style="@style/TrackWidgetButton" />
@@ -146,7 +146,7 @@ limitations under the License.
android:id="@+id/track_widget_record_status"
style="@style/TrackWidgetRecordStatus" />
<ImageButton
android:contentDescription="@string/icon_stop_recording"
android:contentDescription="@string/image_stop"
android:id="@+id/track_widget_stop_button"
android:src="@drawable/ic_button_stop_disabled"
style="@style/TrackWidgetButton" />
@@ -156,6 +156,6 @@ limitations under the License.
</LinearLayout>
</LinearLayout>
<ImageView
android:contentDescription="@string/my_tracks_app_name"
android:contentDescription="@string/image_my_tracks_logo"
style="@style/TrackWidgetLogo" />
</RelativeLayout>
+3 -3
View File
@@ -138,7 +138,7 @@ limitations under the License.
android:layout_weight="1"
style="@style/TrackWidgetVerticalSpacer" />
<ImageButton
android:contentDescription="@string/icon_record_track"
android:contentDescription="@string/image_record"
android:id="@+id/track_widget_record_button"
android:src="@drawable/button_record"
style="@style/TrackWidgetButton" />
@@ -146,7 +146,7 @@ limitations under the License.
android:id="@+id/track_widget_record_status"
style="@style/TrackWidgetRecordStatus" />
<ImageButton
android:contentDescription="@string/icon_stop_recording"
android:contentDescription="@string/image_stop"
android:id="@+id/track_widget_stop_button"
android:src="@drawable/ic_button_stop_disabled"
style="@style/TrackWidgetButton" />
@@ -156,6 +156,6 @@ limitations under the License.
</LinearLayout>
</LinearLayout>
<ImageView
android:contentDescription="@string/my_tracks_app_name"
android:contentDescription="@string/image_my_tracks_logo"
style="@style/TrackWidgetLogo" />
</RelativeLayout>
+3 -3
View File
@@ -142,7 +142,7 @@ limitations under the License.
android:layout_weight="1"
style="@style/TrackWidgetVerticalSpacer" />
<ImageButton
android:contentDescription="@string/icon_record_track"
android:contentDescription="@string/image_record"
android:id="@+id/track_widget_record_button"
android:src="@drawable/button_record"
style="@style/TrackWidgetButton" />
@@ -150,7 +150,7 @@ limitations under the License.
android:id="@+id/track_widget_record_status"
style="@style/TrackWidgetRecordStatus" />
<ImageButton
android:contentDescription="@string/icon_stop_recording"
android:contentDescription="@string/image_stop"
android:id="@+id/track_widget_stop_button"
android:src="@drawable/ic_button_stop_disabled"
style="@style/TrackWidgetButton" />
@@ -160,6 +160,6 @@ limitations under the License.
</LinearLayout>
</LinearLayout>
<ImageView
android:contentDescription="@string/my_tracks_app_name"
android:contentDescription="@string/image_my_tracks_logo"
style="@style/TrackWidgetLogo4x4" />
</RelativeLayout>
+37 -21
View File
@@ -886,37 +886,53 @@ limitations under the License.
Waiting for GPS signal
</string>
<!-- Icon -->
<string name="icon_application"
translation_description="When sharing a track, we display a list of Android applications on the
device that can be used. This is the generic accessibility description for any application
icon.">
<!-- Image -->
<string name="image_application"
translation_description="The accessibility description for a generic application icon.">
Application
</string>
<string name="icon_marker"
translation_description="The accessibility description for the 'Marker' icon.">
<string name="image_arrow"
translation_description="The accessibility description for an arrow image.">
Arrow
</string>
<string name="image_marker"
translation_description="The accessibility description for a marker icon, as opposed to a track
icon.">
Marker
</string>
<string name="icon_my_location"
translation_description="The accessibility description for the 'My Location' icon.">
<string name="image_marker_count"
translation_description="The accessibility description for the marker count icon.">
Marker count
</string>
<string name="image_my_location"
translation_description="The accessibility description for the 'My Location' button.">
My Location
</string>
<string name="icon_pause_recording"
translation_description="The accessibility description for the pause recording icon.">
Pause recording
<string name="image_my_tracks_logo"
translation_description="The accessibility description for the 'My Tracks' logo.">
My Tracks logo
</string>
<string name="icon_record_track"
translation_description="The accessibility description for the record track icon.">
Record track
<string name="image_pause"
translation_description="The accessibility description for the pause button.">
Pause
</string>
<string name="icon_stop_recording"
translation_description="The accessibility description for the stop recording icon.">
Stop recording
<string name="image_photo_marker"
translation_description="The accessibility description for a photo marker">
Photo marker
</string>
<string name="icon_track"
translation_description="The accessibility description for the 'Track' icon.">
<string name="image_record"
translation_description="The accessibility description for the record button.">
Record
</string>
<string name="image_stop"
translation_description="The accessibility description for the stop button.">
Stop
</string>
<string name="image_track"
translation_description="The accessibility description for a track icon, as opposed to a marker
icon.">
Track
</string>
</string>
<!-- Import -->
<string name="import_error"
@@ -189,7 +189,7 @@ public class MarkerListActivity extends AbstractMyTracksActivity implements Dele
String photoUrl = cursor.getString(photoUrlIndex);
ListItemUtils.setListItem(MarkerListActivity.this, view, false, true, iconId,
R.string.icon_marker, name, null, null, null, 0, time, false, category, description,
R.string.image_marker, name, null, null, null, 0, time, false, category, description,
photoUrl);
}
};
@@ -487,7 +487,7 @@ public class SearchListActivity extends AbstractSendToGoogleActivity implements
resultMap.put(IS_PAUSED_FIELD, true);
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(ICON_CONTENT_DESCRIPTION_ID_FIELD, R.string.image_marker);
resultMap.put(NAME_FIELD, waypoint.getName());
resultMap.put(SHARED_OWNER_FIELD, null);
// Display the marker's track name in the total time field
@@ -517,7 +517,7 @@ public class SearchListActivity extends AbstractSendToGoogleActivity implements
resultMap.put(IS_RECORDING_FIELD, track.getId() == recordingTrackId);
resultMap.put(IS_PAUSED_FIELD, recordingTrackPaused);
resultMap.put(ICON_ID_FIELD, TrackIconUtils.getIconDrawable(icon));
resultMap.put(ICON_CONTENT_DESCRIPTION_ID_FIELD, R.string.icon_track);
resultMap.put(ICON_CONTENT_DESCRIPTION_ID_FIELD, R.string.image_track);
resultMap.put(NAME_FIELD, track.getName());
resultMap.put(SHARED_OWNER_FIELD, track.getSharedOwner());
resultMap.put(TOTAL_TIME_FIELD, StringUtils.formatElapsedTime(tripStatitics.getTotalTime()));
@@ -106,7 +106,7 @@ public class TrackController {
recordImageButton.setImageResource(
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));
isRecording && !isPaused ? R.string.image_pause : R.string.image_record));
stopImageButton.setImageResource(
isRecording ? R.drawable.button_stop : R.drawable.ic_button_stop_disabled);
@@ -383,7 +383,7 @@ public class TrackListActivity extends AbstractSendToGoogleActivity
String description = cursor.getString(descriptionIndex);
ListItemUtils.setListItem(TrackListActivity.this, view, isRecording, recordingTrackPaused,
iconId, R.string.icon_track, name, sharedOwner, totalTime, totalDistance, markerCount,
iconId, R.string.image_track, name, sharedOwner, totalTime, totalDistance, markerCount,
startTime, true, category, description, null);
}
};
@@ -88,8 +88,7 @@ public class ListItemUtils {
// Set icon
if (isRecording) {
iconId = isPaused ? R.drawable.ic_track_paused : R.drawable.ic_track_recording;
iconContentDescriptionId = isPaused ? R.string.icon_pause_recording
: R.string.icon_record_track;
iconContentDescriptionId = isPaused ? R.string.image_pause : R.string.image_record;
}
ImageView iconImageView = (ImageView) view.findViewById(R.id.list_item_icon);
@@ -35,7 +35,7 @@ public class MultiColorTrackPathTest extends AndroidTestCase {
}
/**
* Tests the {@link MultiColorTrackPath#getColor(int)} when use dynamic speed
* Tests the {@link MultiColorTrackPath#getColor(double)} when use dynamic speed
* track path descriptor.
*/
public void testGetColor_DynamicSpeedTrackPathDescriptor() {
@@ -894,7 +894,7 @@ public class EndToEndTestUtils {
*/
public static void checkNotRecording() {
instrumentation.waitForIdleSync();
Assert.assertEquals(activityMytracks.getString(R.string.icon_record_track), (String) SOLO
Assert.assertEquals(activityMytracks.getString(R.string.image_record), (String) SOLO
.getCurrentActivity().findViewById(R.id.track_controller_record).getContentDescription());
Assert.assertFalse(SOLO.getCurrentActivity().findViewById(R.id.track_controller_stop)
.isEnabled());
@@ -910,7 +910,7 @@ public class EndToEndTestUtils {
*/
public static void checkUnderRecording() {
instrumentation.waitForIdleSync();
Assert.assertEquals(activityMytracks.getString(R.string.icon_pause_recording), (String) SOLO
Assert.assertEquals(activityMytracks.getString(R.string.image_pause), (String) SOLO
.getCurrentActivity().findViewById(R.id.track_controller_record).getContentDescription());
Assert.assertTrue(SOLO.getCurrentActivity().findViewById(R.id.track_controller_stop)
.isEnabled());
@@ -930,7 +930,7 @@ public class EndToEndTestUtils {
*/
public static void checkUnderPaused() {
instrumentation.waitForIdleSync();
Assert.assertEquals(activityMytracks.getString(R.string.icon_record_track), (String) SOLO
Assert.assertEquals(activityMytracks.getString(R.string.image_record), (String) SOLO
.getCurrentActivity().findViewById(R.id.track_controller_record).getContentDescription());
Assert.assertTrue(SOLO.getCurrentActivity().findViewById(R.id.track_controller_stop)
.isEnabled());
@@ -1001,7 +1001,7 @@ public class EndToEndTestUtils {
for (ImageButton imageButton : aa) {
if (imageButton.getContentDescription() != null
&& imageButton.getContentDescription().equals(
activity.getString(R.string.icon_my_location))) {
activity.getString(R.string.image_my_location))) {
myLocation = imageButton;
break;
}