Android: Quickaction like dialog window to display other components -


i looking implement dialogbox opens when click button. should popular quickaction dialog appears in android phone , twitter app. should able use container can add other elements such buttons, dropdowns, text boxes etc.

of course, needs pop-out of button arrow pointing button invoked dialog. other similar example or barebones description of supposed implement , use should well.

there few examples can use, here of them:

http://shardulprabhu.blogspot.ro/2012/08/blog-post_29.html

https://github.com/lorensiuswlt/newquickaction

https://github.com/lorensiuswlt/newquickaction3d

in opinion first link example it's easy understand , modify. on other hand if can create custom popupwindow , add arrow, here have simple popup example.

  public class mypopup extends popupwindow{    public mypopup (context context) {     super(context);     this.context = context; 

public void show() {

    if (context == null)         return;      layoutinflater layoutinflater = (layoutinflater) context             .getsystemservice(context.layout_inflater_service);     layout = layoutinflater.inflate(r.layout.mypopup_layout, null);      display display = ((activity) context).getwindowmanager()             .getdefaultdisplay();     point size = new point();     display.getsize(size);     int width = size.x;     int height = size.y;       setcontentview(layout);     setwidth(width / 4);     setheight(height / 2);     setfocusable(true);      /**      * clear default translucent background      */     setbackgrounddrawable(new bitmapdrawable(context.getresources()));      init();      /**      * displaying pop-up @ specified location, + offsets.      */     showatlocation(layout, gravity.no_gravity, xpos, ypos);  }   } } 

hope find usefull. cheers


Comments