Google Map's callout view - java

For my Android App I'm using MapBox. Tapping a marker shows a calloutview in the shape of a balloon like expected. Google maps uses a different type of callout view. A view appears on the bottom and when tapped, the view scrolls over the map showing more information about the marker. Is there a specific name for this view? Or maybe a library which does the same thing? Or is it completely custom?
If so is this accomplished by adding a new fragment on top of the MapView? Any help would be much appreciated.
Added some screenshots to clarify what I mean.
Please don't mind the volume bar as it's ridiculously hard to take a screenshots without my device registering a single volume down push -_-

This is not really a view affiliated with the map, so it wouldn't be similar to a Tooltip or callout - you would listen for a touch event on a marker, and then rearrange the view surrounding the MapView, transitioning a separate detail view up and transitioning the map to a different centerpoint.

Related

MapActivity, how to add a progress bar in the marker popup?

I'm using MapActivity and I would like to put a progress bar in the marker popup that appears by clicking on it. I would like to put it under the marker title, in the area where the snippet would have been.
the marker I use is declared as it follows
new MarkerOptions().position(infoLocal.getUserLocation()).title("Your Location").snippet("This is you!").icon(BitmapDescriptorFactory.fromResource(R.drawable.player3)).anchor(0.5f, 0.5f)
As per the Android docs:
'An info window is not a live View. Instead, the view is rendered as an image on the map. As a result, any listeners you set on the view are disregarded and you cannot distinguish between click events on various parts of the view. You are advised not to place interactive components — such as buttons, checkboxes, or text inputs — within your custom info window.'
Hence you can not put live components (like progress bar) in a info window, As it converts the whole view to an image.
If you still want to achieve this, this library may help:
https://github.com/Appolica/InteractiveInfoWindowAndroid

Touch move from one view to another in android

How can i touch move from one view(Imageview/any layout) to another without lifting the finger from the screen for triggering the touch listener of the 2nd view, just like Pinterest menu or Facebook reaction selection view?
If I've understood you correctly, it sounds like you need to implement a ViewPager component which will allow you to navigate various views seamlessly.
You can read about it here on the Android developer page: https://developer.android.com/training/animation/screen-slide.html
Hope it helps.

Bundling in Recyclerview- Android

I want to create a simple view like this. (red circle)
I searched on internet for Bundling in Recyclerview but I could not find any resources.
Can anyone tell me the name of this view or share any tutorial resources.
Can someone share an example of how to do it. Or any Tutorials on how to get this view . - Bounty question
In recyclerview you can do this with item decoration.
An ItemDecoration allows the application to add a special drawing and
layout offset to specific item views from the adapter's data set. This
can be useful for drawing dividers between items, highlights, visual
grouping boundaries and more.
All ItemDecorations are drawn in the order they were added, before the
item views (in onDraw()) and after the items (in onDrawOver(Canvas,
RecyclerView, RecyclerView.State).
refer here
or
you can design a custom layout and inflate it using getViewByType in
viewholder
I think you better to follow this videos, i am sure my side this videos gives you a perfect idea on Android Recyclerview and also provide a solution for problem.
Please follow this youtube link: https://www.youtube.com/watch?v=XhbsNO2_oDI
ItemDecorator from example below doesn't suite you. Try to use Expandable Listview, which helps you to adjust list, when user tap on image below list item, and expand size for another item, for example, chat messages in your image.
Use This Example!

Button on android map annotation

After a while of googling I cannot find what I need, I see some libraries which look to do it but I have already implemented the system using androids default methods.
I set the markers like so:
theMap.addMarker(new MarkerOptions()
.position(new LatLng(lat, lon))
.title(title)
.icon(BitmapDescriptorFactory.fromResource(R.drawable.pin_map32))
.snippet(strap));
However I need a 'detail disclosure button' like on iOS (transitioning app from iOS to Android) and I can't seem to add a button to the marker - is it possible using androids system?
This cannot be done.
from the docs
Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.
in other words you cannot put a button in the infowindow and be able to use it. You will need to use a dialog of sorts if you want to do something like that
There is always some way.
A nice hack can be found here: https://stackoverflow.com/a/15040761/2183804
I haven't tested it myself, but from the comments there (and the amount of upvotes) we can deduce it works well.
You can track clicks only on Marker. If you want a button on marker - click on marker & show a dialog with buttons.

Scrolling a View by code

I want to programatically scroll a View. So far, I have found two possibilities :
scrollTo(x,y) : the top left hand corner of the View corresponds to the point (x,y) of what must be drawn in the View. The problem is that, after the call, it is impossible to manually scroll the View to have it displays what is above y or what is at the left of x.
setScrollY(y) : seems to be the function I'm looking for. But it is only available for API above level 14. And my application is supposed to work with API level 8.
Is there another function which could do what I want to do?
Thanks in advance for the time you will spend trying to help me.
Is your View in a ScrollView? If not, you will need to handle events yourself to manually scroll the View after you use code to set the scroll location. It sounds like you want both manual and programmatic control, so you'll need to use a scrolling container or handle touch events yourself.

Categories