com.devoteam.quickaction
Class QuickActionWindow

java.lang.Object
  extended by PopupWindow
      extended by com.devoteam.quickaction.QuickActionWindow

public class QuickActionWindow
extends PopupWindow

A class that can display, as a popup badge, a collection of QuickActionItems Based on the great work done by Mohd Faruq


Constructor Summary
QuickActionWindow(Context context, View pView, Rect rect)
          Creates a new Instance of the QuickActionWindow
 
Method Summary
 void addItem(Drawable drawable, int resid, OnClickListener l)
          Adds an item to the QuickActionWindow
 void addItem(Drawable drawable, java.lang.String text, OnClickListener l)
          Adds an item to the QuickActionWindow
 void addItem(int drawable, int resid, OnClickListener l)
          Adds an item to the QuickActionWindow
 void addItem(int drawable, java.lang.String text, OnClickListener l)
          Adds an item to the QuickActionWindow
 boolean onKeyDown(int keyCode, KeyEvent event)
           
 boolean onKeyLongPress(int keyCode, KeyEvent event)
           
 boolean onKeyMultiple(int keyCode, int count, KeyEvent event)
           
 boolean onKeyUp(int keyCode, KeyEvent event)
           
 void show()
          Shows the quick actions window
 void show(int requestedX)
          Shows the quick actions window
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickActionWindow

public QuickActionWindow(Context context,
                         View pView,
                         Rect rect)
Creates a new Instance of the QuickActionWindow

Parameters:
context - Context to use, usually your Appication or your Activity
pView - The view you want to anchor the window on (the parent)
rect - Rectangle defining the view area
Method Detail

addItem

public void addItem(Drawable drawable,
                    java.lang.String text,
                    OnClickListener l)
Adds an item to the QuickActionWindow

Parameters:
drawable - Icon to be shown
text - Label to be shown below the drawable
l - Definition for the callback to be invoked when the view is cliked

addItem

public void addItem(int drawable,
                    java.lang.String text,
                    OnClickListener l)
Adds an item to the QuickActionWindow

Parameters:
drawable - Icon resource id to be shown
text - Label to be shown below the drawable
l - Definition for the callback to be invoked when the view is cliked

addItem

public void addItem(Drawable drawable,
                    int resid,
                    OnClickListener l)
Adds an item to the QuickActionWindow

Parameters:
drawable - Icon to be shown
text - Label resource id to be shown below the drawable
l - Definition for the callback to be invoked when the view is cliked

addItem

public void addItem(int drawable,
                    int resid,
                    OnClickListener l)
Adds an item to the QuickActionWindow

Parameters:
drawable - Icon resource id to be shown
text - Label resource id to be shown below the drawable
l - Definition for the callback to be invoked when the view is cliked

show

public void show(int requestedX)
Shows the quick actions window

Parameters:
requestedX - The X coordinate the arrow will point at

show

public void show()
Shows the quick actions window


onKeyUp

public boolean onKeyUp(int keyCode,
                       KeyEvent event)

onKeyDown

public boolean onKeyDown(int keyCode,
                         KeyEvent event)

onKeyMultiple

public boolean onKeyMultiple(int keyCode,
                             int count,
                             KeyEvent event)

onKeyLongPress

public boolean onKeyLongPress(int keyCode,
                              KeyEvent event)