How to reposition controlMarkerUI for Google Maps API in Android Studio - java

I've finally managed to get the setMyLocationEnabled(true) feature to show up on my map. But I have no clue how to set the constraints for the "recenter" button or the compass that comes with it. They're positioned on the top left and top right by default.
Is there anyway to reposition them or access their constraints?
The activity_maps.xml doesn't show anything.

Related

Android Studio layout design

after i drag some elements into ConstraintLayout , there is no element show up on the preview screen , and after run in AVD , all elements was stuck in the top left corner , i am not able to set the position of elements
You're preview settings is on API 28 which probably you don't. change it to any API Level which you have installed.
Default behavior of ConstraintLayout is all views inside it moved to top left corner of it. You must use ConstraintLayout attributes or design features to position views where ever you want.
Take a look at this: developer.android.com

Android studio - The view is not constraiined it only has designtime positions so it will jump to (0,0) unless you add constraints

The view is not constraiined it only has designtime positions so it will jump to (0,0) unless you add constraints.
Hi there could anybody help me with this? im loading up my project on Android studio and this keeps coming up? Any easy options to get rid of this error so i can connect my phone and use it?
Find the dots on the center of the edge of the view and pull the arrow to the edege of its parent view. You have to just do it for two sides (left/right) and(top/bottom).
Instead of adding constraints to every view as you place them in the layout, you can move each view into the positions you desire, and then click Infer Constraints to automatically create constraints.
view more here
https://developer.android.com/training/constraint-layout/index.html

Buttons showed when a marker is clicked in a MapsActivity in Android

I'm developing a simple app that uses one MapsActivity. Since I'm new to Android app developing, I have some doubts.
I've seen that when you click to a marker you've previously added, two buttons show up on the inferior right corner. One is to open Google Maps itself, and the other to open Google Maps with a route to the marker.
What are the activities that those two buttons start? I would just like to remove those two default buttons and make one myself with a text like "Show route", the problem is that I don't know how to acces to those two buttons (so I can remove them) and the activities they manage.
Thanks.
Try this:
mMap.getUiSettings().setMapToolbarEnabled(false);
Edit:
Please note that your mMap variable has to be initialized, otherwise you will get a null pointer exception

Google Maps Android -- How access default infowindow?

I have a map that shows a few points. If the user searches for a location instead of using their default location, a placemark will show for the searched location as well. This placemark shows the infowindow by default. All of these points are shown on screen (using a bounding box).
However, although I can account for the placemark to be shown on screen inside a bounding box, I am currently unable to make sure its infowindow is completely visible on screen. For example, if the placemark is the northeast-most item, its infowindow will be overflowing off the screen both on the top and the right.
Is there any way to get the infowindow of a marker? I know I can build one out using the CustomWindowAdapter and later access that view, but I don't want to customize it at all, just to be able to access it (and not just be able to call show or hideinfowindow() from the marker).
Ideally, I could get the height and width of the infowindow in pixels and use that to make sure it is always completely shown on screen.
No, you cannot. What you see as "info window" inside the map view is nothing more than a buffered snapshot (or a screen dump if you will) of the view created by your InfoWindowAdapter, meaning it's not a traditional view added to the view hierarchy, rather it's an image shown in the OpenGL context.
Accessing or manipulating this view after showInfoWindow() won't make any difference to what gets displayed on the map, at least until you call showInfoWindow() again to take a new snapshot.
It's the same reason you cannot add a long-click listener to the info window.

Android Dropdown Effect - Spinner or not?

Achieving a true "dropdown" effect (as seen in Adobe's Photoshop Mobile app for Android, image below) has proven challenging using Androids built-in methods.
As others on Stackoverflow have told me, editing the style of a dropdown list view of an Android spinner is limiting.
How is this dropdown effect done?
(I can't seem to get an image to show, so here's a link: Adobe Photoshop Mobile for Android
After viewing the Adobe slideshow I think the way I would attempt to get that to work, using the Android Java SDK, would be to create a ListView object with a transparent background, and then dynamically hide/show it in that position when the menu button is clicked by setting the View's visibility to VISIBLE or GONE.
Getting a ListView to be transparent shouldn't be that difficult. I'd look into AbsoluteLayout to get it to hover over everything in that spot.
Another option might be to display the ListView in a custom Dialog that you've written, again positioning it in that exact spot on the screen so that it looks like a menu extending from the button that was clicked.
It's probably done using low-level draw functions.

Categories

Resources