Android: Google Maps API - Change position of maps toolbar
Thought of commenting, But has low reputation. So:
As far as I know, there is no way to position it for now. It'll appear at its default position only.
As Nathan said I should add some alternative if possible. So,There is a work around: You can disable the map's toolbar. and can add appcompact's ToolBar anywhere in the layout.
Reference : https://developer.android.com/reference/android/support/v7/widget/Toolbar.html
How to change the position of My Location Button in Google Maps using android studio
you can use this
View locationButton = ((View) mMapView.findViewById(Integer.parseInt("1")).getParent()).findViewById(Integer.parseInt("2"));
RelativeLayout.LayoutParams rlp = (RelativeLayout.LayoutParams) locationButton.getLayoutParams();
// position on right bottom
rlp.addRule(RelativeLayout.ALIGN_PARENT_TOP, 0);
rlp.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
rlp.setMargins(0, 180, 180, 0);
changing the position of google maps SupportMapFragment Zoom and My location controls not work
You can find Location button on map by getting parent view first and then "My Location" button as below :
// Get the "My Location" button view
View locationButton = ((View) mapView.findViewById(1).getParent()).findViewById(2);
// get button params to place the button
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) locationButton.getLayoutParams();
// place on right bottom corner
rlp.addRule(RelativeLayout.ALIGN_PARENT_TOP, 0);
rlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
rlp.setMargins(0, 0, 30, 30);
If want to resize button, you can get parameters like below :
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(100, 100);
//.... do your editing
// To set params to button
locationButton.setLayoutParams(lp);
Changing Android Maps Toolbar animation
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
Related Topics
Using Asynctask with Passing a Value
App Crashing When Trying to Use Recyclerview on Android 5.0
Listview Viewholder Checkbox State
Reducing Android App (Apk) Size
How to Launch Home Screen Programmatically in Android
What Is the Use of Memoryfile in Android
R: Cannot Install Rjava; What Is R-Api-3.4
Calling a Java Servlet from JavaScript
Is a Hashmap Thread-Safe for Different Keys
Check Chains of "Get" Calls for Null
Driver Jdbc Postgresql with Android
How to Resolve "Duplicate Files Copied in APK Meta-Inf/*"
Caused By: Java.Lang.Classnotfoundexception: Didn't Find Class in Firebase Phone Authentication
Reusing Views in Android Listview with 2 Different Layouts
How to Crop a Bitmap for Imageview
Date Format Conversion Android