MapView overdraw + fix

Discussion created by chirrup on Sep 26, 2013
Latest reply on Sep 28, 2013 by tmsbn90
There some really simple drawing optimizations that can be implemented on MapView. Just sharing them.

For example, take Set target android:targetSdkVersion="18" in manifest and target=android-18 in (actually, anything above android-10 will work). Now go to device Settings -> Developer options and enable "Show GPU overdraw" option. Start the sample. As you can see, map now has green overlay on it, meaning that there are 2 things overdrawing on the area the map is in.

1) Window background. It can be removed by calling getWindow().setBackgroundDrawable(null); somewhere in activity. This optmization might not be suitable for apps that don't have MapView covering their whole window.

2) MapView background drawable. Why does the MapView need background drawable? Who knows... but you can remove it by calling mMapView.setBackgroundDrawable(null);

Hierarchy Viewer shows ~3ms decrease in drawing time.