Skip to content

Instantly share code, notes, and snippets.

@jdsingh
Forked from Manabu-GT/googleMapMyLocation
Created November 14, 2015 08:02
Show Gist options
  • Save jdsingh/6741c8146c025a3b8f77 to your computer and use it in GitHub Desktop.
Save jdsingh/6741c8146c025a3b8f77 to your computer and use it in GitHub Desktop.
Android - adjust google map's my location button
//HACK: Get the button view and place it on the bottom right (as Google Maps app)
View locationButton = ((View) mMapFragment.getView().findViewById(1).getParent()).findViewById(2);
RelativeLayout.LayoutParams rlp = (RelativeLayout.LayoutParams) locationButton.getLayoutParams();
rlp.addRule(RelativeLayout.ALIGN_PARENT_TOP, 0);
rlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
rlp.setMargins(0, 0, 30, 30);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment