3

I'm looking to integrate the feels of Foursquare map in my application. So I have created a MapFragment a ListFragment.

I placed them both in my Activity where the map is placed to take the whole screen size, while the list fragment set a little bit down, So you can see the map partially, and the other part is covered with the list. Now my guess is that this is the way the implemented it, because for what I know there is no way to expand the MapFragment to full screen with animation without the map rendering it self all over again.

So first of all is this the right way to do this? or should I place the MmapFragment on the up part of the Activity and the list bellow it? if so how would I expand it without glitches?

If it's the first option then then I need to find a way to place the map in the small view (when it's partially seen) in a way that my location is in the center also, but because the map is set from the beginning to full screen the my location is centered at the center of the screen and basically covered by the list.

How could I implement such a map expandable effect?

halfer
  • 19,824
  • 17
  • 99
  • 186
Emil Adz
  • 40,709
  • 36
  • 140
  • 187

1 Answers1

5

Option 1 + GoogleMap.setPadding. It offsets what is considered a center of the VisibleRegion.

More about it here: https://developers.google.com/maps/documentation/android/map#map_padding

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94
  • wasn't aware of this .setPadding method, I'll take a look at it and let you know what I came up with. Thank you very much. – Emil Adz Nov 07 '13 at 13:48
  • I managed to get something similar to what they did. But it some what glitchy, and I wounder how could they do this, because they don't use the setPadding method, I know that because when the map is small the Google logo is not seen, what means it in the bottom of the screen under the layout that covers it. So how they placed the map in the small part on the center of user's location? – Emil Adz Nov 08 '13 at 19:21
  • Yeah it looks OK there, but could you think of any other way to complete such a task? because Foursquare doesn't use this new setPadding future. – Emil Adz Nov 08 '13 at 20:26
  • I guess that if I'll use this method, and the phone doesn't have the last google play services updated, the application will crush, So I'm looking for another way to implement the same effect. – Emil Adz Nov 09 '13 at 11:24