Hello,
can anybody give me solution for how to change place of current location default icon (as rounded in above image right corner) from right corner to left corner.?
thanks.
According to this thread, you can reposition the items by using GoogleMap.setPadding(left, top, right, bottom).
Here is the actual statement:
We added GoogleMap.setPadding(left, top, right, bottom), which allows you to indicate parts of the map that may be obscured by other views. Setting padding re-positions the standard map controls, and camera updates will use the padded region.
https://developers.google.com/maps/documentation/android/map#map_padding
If you want to do that, you should hide the default my location button and add your own Button to the layout on the left side, handling onClick to call animateCamera. You cannot reuse default button's drawables this way.
Note: this is not a good idea, because other apps will have this button in the right corner in other apps using maps and may expect it to be there in your app.
Related
I am making a navigation application using HERE SDK Android. During the middle of navigation, I want to expand an overlayed view on top of my map on the left. This causes some of my navigation views to be cut off. So I want to shift the center of my navigation to the right. That way the route and my arrows will be shifted to the right of the screen where they can be seen.
Is there a way to accomplish this using the HERE android SDK?
I have tried looking at MapSchemes but this does not seem to do what I want.
I think to put it more succinctly I want to shift my center point of the map to the right during navigation.
Have a look at setTransformCenter in the Map class.
That sounds like what you are looking for:
Sets a center coordinate for Map transformations such as zooming.
Transformations performed after calling this method will be based on
this new center coordinate. The transform center may be different than
the Map center. Developer must not use this method and setPadding(int,
int, int, int) at the same time as the only one of them will be taken
into account, depending on the order of invocation.
See https://developer.here.com/documentation/android-starter/api_reference_java/com/here/android/mpa/mapping/Map.html#setTransformCenter-android.graphics.PointF-
Is it possible to change the alpha value of an ImageView along a specific direction i.e. from top to bottom or bottom to top on Android?
I am trying to animate with imageView.animate().alpha(0).setDuration(500).start();
however this just fades the entire view out uniformly, but I'd like to do this form top to bottom instead.
Any help appreciated.
As far as I know, it is not (yet) possible with the Android built in animations. You will have to create your own custom animation.
Haven't tried, but maybe you can achieve this by using the Transformation class, and/or overriding the onApplyTransformation method from the AlphaAnimation class
method.
I am experimenting with Views in Android and am trying to create a custom 'widget'. What I want to do is create a portion of a circle with an indicator at 12'o clock. I'd then like to to swipe over the circle and when I do, I'd like to see the indicator move to left or right corresponding to a swipe to the left or the right.
I have looked up a number of sources however I am unsure of how to draw an 'indicator' within the arc. In addtion, what needs to be done to animate the arc ? Can this be achieved without OpenGL ?
I am aware of the circlular progress bar and I believe the problem is quite similar, however I didn't have to add a marker inside the circle.
Here is an image of the screen shot of the View I would like to recreate:
This approach would work,Creating a View with rounded corners and position it to bottom to make it seem like arc
The android app that I am building contains a map activity. In that activity I need the user to specify a circle around its location.
And the radius of this circle needs to be provided by user. So what could be the best UI element to let the user specify the radius.
Best option that comes to my mind is a seek bar. One sliding it to one end, radius increases and vice versa.
Any thoughts?
A plus and minus button (like google maps has for zooming)
A gesture (2 finger to the edges of the screen for increasing the size e.g.) [no real UI element, but maybe more user-friendly]
A vertical or horizontal slider
I'm trying to do something which seems simple. I want to have a map view, with a menu that slides up from the bottom of the screen where settings (for overlay) can be adjusted. However when I use a TranslateAnimation to affect the y position of the LinearLayout (which holds the menu), the buttons in the LinearLayout move, but there "hit area" stays in the same position as they were before the animation.
TranslateAnimation slide = new TranslateAnimation(0,0,0,0);
slide.setDuration(300);
slide.setFillAfter(true);
pullupMenu.startAnimation(slide);
mapContainer.startAnimation(slide);
I've also looked into tweening the view's marginTop value, but haven't even been able to determine how that would be done.
Any help on either of these directions would be much appreciated.
The animation in general is animating the pixels of the widget. My suspicion, based on what you wrote, is that setFillAfter() merely arranges for the pixels to stay in the destination location, not the widget itself.
If you want the animation to actually wind up moving the widget, you need to:
Register a listener to find out when the animation ends, and
Arrange at that point to modify the layout rules such that the widget actually exists in the new location
You can see a sliding pane that employs this technique here.