com.drismo.gui.quickaction
Class QuickAction

java.lang.Object
  extended by com.drismo.gui.quickaction.CustomPopupWindow
      extended by com.drismo.gui.quickaction.QuickAction

public class QuickAction
extends CustomPopupWindow

Popup window, shows action list as icon and text (QuickContact / Twitter app).


Field Summary
private  java.util.ArrayList<ActionItem> actionList
           
static int ANIM_AUTO
           
static int ANIM_GROW_FROM_CENTER
           
static int ANIM_GROW_FROM_LEFT
           
static int ANIM_GROW_FROM_RIGHT
           
private  boolean animateTrack
           
private  int animStyle
           
private  android.content.Context context
           
private  android.view.LayoutInflater inflater
           
private  android.widget.ImageView mArrowDown
           
private  android.widget.ImageView mArrowUp
           
private  android.view.ViewGroup mTrack
           
private  android.view.View root
           
 
Fields inherited from class com.drismo.gui.quickaction.CustomPopupWindow
anchor, window, windowManager
 
Constructor Summary
QuickAction(android.view.View anchor)
          Constructor
 
Method Summary
 void addActionItem(ActionItem action)
          Add action item
 void animateTrack(boolean animateTrack)
          Animate track
private  void createActionList()
          Create action list
private  android.view.View getActionItem(java.lang.String title, android.graphics.drawable.Drawable icon, android.view.View.OnClickListener listener)
          Get action item View
private  void setAnimationStyle(int screenWidth, int requestedX, boolean onTop)
          Set animation style
 void setAnimStyle(int animStyle)
          Set animation style
 void show()
          Show popup window
private  void showArrow(int whichArrow, int requestedX)
          Show arrow
 
Methods inherited from class com.drismo.gui.quickaction.CustomPopupWindow
dismiss, onCreate, onShow, preShow, setBackgroundDrawable, setContentView, setContentView, setOnDismissListener, showDropDown, showDropDown, showLikeQuickAction, showLikeQuickAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private final android.view.View root

mArrowUp

private final android.widget.ImageView mArrowUp

mArrowDown

private final android.widget.ImageView mArrowDown

inflater

private final android.view.LayoutInflater inflater

context

private final android.content.Context context

ANIM_GROW_FROM_LEFT

public static final int ANIM_GROW_FROM_LEFT
See Also:
Constant Field Values

ANIM_GROW_FROM_RIGHT

public static final int ANIM_GROW_FROM_RIGHT
See Also:
Constant Field Values

ANIM_GROW_FROM_CENTER

public static final int ANIM_GROW_FROM_CENTER
See Also:
Constant Field Values

ANIM_AUTO

public static final int ANIM_AUTO
See Also:
Constant Field Values

animStyle

private int animStyle

animateTrack

private boolean animateTrack

mTrack

private android.view.ViewGroup mTrack

actionList

private java.util.ArrayList<ActionItem> actionList
Constructor Detail

QuickAction

public QuickAction(android.view.View anchor)
Constructor

Parameters:
anchor - View on where the popup should be displayed
Method Detail

animateTrack

public void animateTrack(boolean animateTrack)
Animate track

Parameters:
animateTrack - flag to animate track

setAnimStyle

public void setAnimStyle(int animStyle)
Set animation style

Parameters:
animStyle - animation style, default is set to ANIM_AUTO

addActionItem

public void addActionItem(ActionItem action)
Add action item

Parameters:
action - ActionItem

show

public void show()
Show popup window


setAnimationStyle

private void setAnimationStyle(int screenWidth,
                               int requestedX,
                               boolean onTop)
Set animation style

Parameters:
screenWidth - Screen width
requestedX - distance from left screen
onTop - flag to indicate where the popup should be displayed. Set TRUE if displayed on top of anchor and vice versa

createActionList

private void createActionList()
Create action list


getActionItem

private android.view.View getActionItem(java.lang.String title,
                                        android.graphics.drawable.Drawable icon,
                                        android.view.View.OnClickListener listener)
Get action item View

Parameters:
title - action item title
icon - Drawable action item icon
listener - View.OnClickListener action item listener
Returns:
action item View

showArrow

private void showArrow(int whichArrow,
                       int requestedX)
Show arrow

Parameters:
whichArrow - arrow type resource id
requestedX - distance from left screen