how to add contentDesctiption to InfoWindow or marker in Android GoogleMaps V2 for TalkBack how to add contentDesctiption to InfoWindow or marker in Android GoogleMaps V2 for TalkBack android android

how to add contentDesctiption to InfoWindow or marker in Android GoogleMaps V2 for TalkBack


For marker, i used marker.setTitile() and it worked, still don't know how to make InfoWindow works.


What we did in an old project was to programmatically build and announce the content description when we receive the marker clicked callback.

You can check AccessibilityManager, AccessibilityRecordCompat and AccessibilityEvent.

But there is no focus navigation (navigate swiping left-right or right-left) support currently in the SDK for info markers. Focus navigation is very common for blind people to use.

Regards.


Do you mean design a new info window? You should first write a .xml layout file, then:

map.setInfoWindowAdapter(new InfoWindowAdapter() {        // Use default InfoWindow frame        @Override        public View getInfoWindow(Marker arg0) {            return null;        }        // Defines the contents of the InfoWindow        @Override        public View getInfoContents(Marker arg0) {            String namepic = arg0.getTitle();            // Getting view from the layout file info_window_layout            View v = getLayoutInflater()                    .inflate(R.layout.info_window, null);            LatLng latLng = arg0.getPosition();            // Getting the position from the marker            TextView tvtitle = (TextView) v.findViewById(R.id.tv_title);            TextView tvLat = (TextView) v.findViewById(R.id.tv_lat);            TextView tvLng = (TextView) v.findViewById(R.id.tv_lng);            ImageView myimage = (ImageView) v.findViewById(R.id.my_image);            tvtitle.setText(arg0.getTitle());            tvLat.setText("Latitude:" + latLng.latitude);            tvLng.setText("Longitude:" + latLng.longitude);            // Returning the view containing InfoWindow contents            myimage.setImageResource(getResources().getIdentifier(namepic,                    "drawable", getPackageName()));            return v;        }    });