[android] - add accessibility support to the Android SDK by applying content descriptions on Views overlain on the map. (#8230)

This commit is contained in:
Tobrun
2017-03-01 17:07:01 -05:00
committed by GitHub
parent 95fdf3ca0d
commit ef82095a21
7 changed files with 27 additions and 13 deletions

View File

@@ -636,6 +636,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.imageView.setImageBitmap(marker.getIcon().getBitmap());
viewHolder.imageView.setContentDescription(marker.getTitle());
return convertView;
}

View File

@@ -118,6 +118,9 @@ public class MapView extends FrameLayout {
ImageView attrView = (ImageView) view.findViewById(R.id.attributionView);
initalizeDrawingSurface(context, options);
// add accessibility support
setContentDescription(context.getString(R.string.mapbox_mapActionDescription));
// create native Map object
nativeMapView = new NativeMapView(this);

View File

@@ -56,7 +56,6 @@ public final class CompassView extends AppCompatImageView implements Runnable, F
private void initialize(Context context) {
setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.mapbox_compass_icon));
setContentDescription(getResources().getString(R.string.mapbox_compassContentDescription));
setEnabled(false);
// Layout params