Skip to content

Instantly share code, notes, and snippets.

@flasher297
Forked from Manabu-GT/googleMapMyLocation
Created December 19, 2016 16:27
Show Gist options
  • Save flasher297/ff3750c93d08ce53eadcbf0aab25d505 to your computer and use it in GitHub Desktop.
Save flasher297/ff3750c93d08ce53eadcbf0aab25d505 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