1

I changed the position of my Maps Toolbar so that it is positioned in the left top corner of my Android App using this code:

 RelativeLayout.LayoutParams toolbarParams = (RelativeLayout.LayoutParams) toolbar.getLayoutParams();
 toolbarParams.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
 toolbarParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
 toolbarParams.setMargins(0, 15, 10, 0);
 toolbar.setLayoutParams(toolbarParams);

The position is correct, but once I click a marker, the toolbar flies in from the right side of the screen which looks bad. I'm trying to find a way to change the direction of that animation, so that it flies in from the left side of the screen, as its closer to the actual position.

I couldn't find any information on how to do it on the internet . Is it possible in any way?

1 Answers1

0

I did some research and I found a Stack Overflow ticket similar to you inquiry. You can disable the map's toolbar and add appcompat toolbar. Toolbar may be placed at any arbitrary level of nesting within a view hierarchy using setSupportActionBar() method.

Here's a link were I found the solution: Android: Google Maps API - Change position of maps toolbar

Here's a Official Google document for Toolbar: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html

Community
  • 1
  • 1
Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30