com.drismo.gui.quickaction
Class CustomPopupWindow

java.lang.Object
  extended by com.drismo.gui.quickaction.CustomPopupWindow
Direct Known Subclasses:
QuickAction

public class CustomPopupWindow
extends java.lang.Object

This class does most of the work of wrapping the PopupWindow so it's simpler to use. Edited by Lorensius. W. L. T


Field Summary
protected  android.view.View anchor
           
private  android.graphics.drawable.Drawable background
           
private  android.view.View root
           
protected  android.widget.PopupWindow window
           
protected  android.view.WindowManager windowManager
           
 
Constructor Summary
CustomPopupWindow(android.view.View anchor)
          Create a QuickAction
 
Method Summary
 void dismiss()
           
protected  void onCreate()
          Anything you want to have happen when created.
protected  void onShow()
          In case there is stuff to do right before displaying.
protected  void preShow()
           
 void setBackgroundDrawable(android.graphics.drawable.Drawable background)
           
 void setContentView(int layoutResID)
          Will inflate and set the view from a resource id
 void setContentView(android.view.View root)
          Sets the content view.
 void setOnDismissListener(android.widget.PopupWindow.OnDismissListener listener)
          If you want to do anything when dismiss is called
 void showDropDown()
          Displays like a popdown menu from the anchor view
 void showDropDown(int xOffset, int yOffset)
          Displays like a popdown menu from the anchor view.
 void showLikeQuickAction()
          Displays like a QuickAction from the anchor view.
 void showLikeQuickAction(int xOffset, int yOffset)
          Displays like a QuickAction from the anchor view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

anchor

protected final android.view.View anchor

window

protected final android.widget.PopupWindow window

root

private android.view.View root

background

private android.graphics.drawable.Drawable background

windowManager

protected final android.view.WindowManager windowManager
Constructor Detail

CustomPopupWindow

public CustomPopupWindow(android.view.View anchor)
Create a QuickAction

Parameters:
anchor - the view that the QuickAction will be displaying 'from'
Method Detail

onCreate

protected void onCreate()
Anything you want to have happen when created. Probably should create a view and setup the event listeners on child views.


onShow

protected void onShow()
In case there is stuff to do right before displaying.


preShow

protected void preShow()

setBackgroundDrawable

public void setBackgroundDrawable(android.graphics.drawable.Drawable background)

setContentView

public void setContentView(android.view.View root)
Sets the content view. Probably should be called from onCreate

Parameters:
root - the view the popup will display

setContentView

public void setContentView(int layoutResID)
Will inflate and set the view from a resource id

Parameters:
layoutResID -

setOnDismissListener

public void setOnDismissListener(android.widget.PopupWindow.OnDismissListener listener)
If you want to do anything when dismiss is called

Parameters:
listener -

showDropDown

public void showDropDown()
Displays like a popdown menu from the anchor view


showDropDown

public void showDropDown(int xOffset,
                         int yOffset)
Displays like a popdown menu from the anchor view.

Parameters:
xOffset - offset in X direction
yOffset - offset in Y direction

showLikeQuickAction

public void showLikeQuickAction()
Displays like a QuickAction from the anchor view.


showLikeQuickAction

public void showLikeQuickAction(int xOffset,
                                int yOffset)
Displays like a QuickAction from the anchor view.

Parameters:
xOffset - offset in the X direction
yOffset - offset in the Y direction

dismiss

public void dismiss()