Created
March 17, 2013 15:17
-
-
Save groodt/5181980 to your computer and use it in GitHub Desktop.
"Fix" SupportMapFragment issues Android 2.3.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Janky "fix" to prevent artefacts when embedding GoogleMaps in a sliding view. | |
// https://github.com/jfeinstein10/SlidingMenu/issues/168 | |
// set background to transparent | |
private void setMapTransparent(ViewGroup group) { | |
int childCount = group.getChildCount(); | |
for (int i = 0; i < childCount; i++) { | |
View child = group.getChildAt(i); | |
if (child instanceof ViewGroup) { | |
setMapTransparent((ViewGroup) child); | |
} else if (child instanceof SurfaceView) { | |
child.setBackgroundColor(0x00000000); | |
} | |
} | |
} | |
// call it on the SupportMapFragment somewhere | |
setMapTransparent((ViewGroup) supportMapFragment.getView()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment