0

enter image description here

enter image description here

Can anyone tell me what control or how do you create the pop-up effect used in these images to display the legend? The screenshots are taken from an app called FlyOKC. Any help is greatly appreciated, thank you.

Fiur
  • 632
  • 1
  • 6
  • 20

3 Answers3

1

That's certainly using a custom version of a dialog. The idea is to implement your layout in a xml and inflate it in a dialog. There's a lot of tutorials around, try that one.

Romain Piel
  • 11,017
  • 15
  • 71
  • 106
  • I think that legend is meant to stick and let the user interact with the rest of the screen. Dialog doesn't seem proper for this kind of situation. – Ivan Bartsov Feb 03 '12 at 15:40
1

This is not exactly a custom dialog. But, yes it is still a customized view. And it is more or less called Quick Action Dialog in android. I would suggest you to follow the tutorials below for generating an exactly same popover (or even better) with Android. Check the screenshot also.

enter image description here

C--
  • 16,393
  • 6
  • 53
  • 60
  • No, I don't think this is a quick action dialog either. The legend doesn't take any actions and is not dismissed when it or anything else except the button is clicked. – Ivan Bartsov Feb 03 '12 at 15:45
  • Ok, in that case, Ivan's answer is more valid. But the fact is that you have to take good care not to clutter your UI with that solution. But, yes Ivan's answer is more valid. – C-- Feb 03 '12 at 16:08
  • It's probably not exactly what they used there, but i will accept your answer because i can achieve the same effect using QuickAction Dialog and it seems easier to implement – Fiur Feb 07 '12 at 10:32
0

Actually, that can be achieved by using RelativeLayout and switching the legend view's visible state between View.VISIBLE and View.GONE in button's click handler.

To get the exact animation you'll need to jump some hoops. Here are related threads:

How does one Animate Layout properties of ViewGroups?

How do I animate View.setVisibility(GONE)

Also, I think another (and possibly easier) way would be to use Fragments API with transition effects, in which case this is the thread to read:

Animate the transition between fragments

Community
  • 1
  • 1
Ivan Bartsov
  • 19,664
  • 7
  • 61
  • 59