public class

QuickActionBar

extends Object
implements ActionInterfaces.Window.ActionWindowInterface
java.lang.Object
   ↳ com.droidux.pack.action.widget.QuickActionBar

Class Overview

An action widget that presents a set of actions in a scrollable bar (see here for example).

Summary

Constants
int ANIM_AUTO Automatically determine the appropriate animation based on the popup window location.
int ANIM_DEFAULT
int ANIM_FADE Fade animation.
int ANIM_GROW_FROM_CENTER Grow from center
int ANIM_GROW_FROM_LEFT Grow from left.
int ANIM_GROW_FROM_RIGHT Grow from right.
int ANIM_NONE No animation.
Public Constructors
QuickActionBar(Context context)
Public Methods
ActionInterfaces.Layout.ActionLayoutInterface beginLayout()
Begins the layout process to define the ActionInterfaces.Item.ActionItem that should be hosted by this action container.
void dismiss()
Dispose of the popup window.
boolean isShowing()
Indicates whether the popup window is showing on screen.
void onEndLayout(ActionInterfaces.Layout.ActionLayoutInterface layout)
Called when the layout process has ended (for internal use only, you normally don't need to call/override this method).
void setAnimateTrack(boolean animateTrack)
Sets whether to animate the track.
void setAnimationStyle(int animStyle)
Sets the style of the window animation.
void setBackgroundDrawable(Drawable background)
Sets the background to a given Drawable, or remove the background.
void setDismissOnClick(boolean dismiss)
Sets whether to dismiss the window when the user click on an action item.
void setDismissOnClick(boolean dismiss, int delay)
Sets whether to dismiss the window when the user click on an action item.
void setOnDismissListener(PopupWindow.OnDismissListener listener)
Sets the listener to be notified when the window is dismissed.
void setTitle(String title)
Sets the title of the window.
void show(View parent, int targetXPos, int targetYPos)
Display the content view in a popup window at the specified location.
void show(View anchor)
Display the content view in a popup window anchored to the anchor view.
Protected Methods
abstract void createActionViews()
abstract int getContentLayoutId()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.droidux.pack.action.interfaces.ActionInterfaces.Window.ActionWindowInterface
From interface com.droidux.pack.action.interfaces.ActionInterfaces.Window.PopupWindowInterface

Constants

public static final int ANIM_AUTO

Since: API Level

Automatically determine the appropriate animation based on the popup window location.

Constant Value: 4 (0x00000004)

public static final int ANIM_DEFAULT

Since: API Level

Constant Value: -1 (0xffffffff)

public static final int ANIM_FADE

Since: API Level

Fade animation.

Constant Value: 5 (0x00000005)

public static final int ANIM_GROW_FROM_CENTER

Since: API Level

Grow from center

Constant Value: 3 (0x00000003)

public static final int ANIM_GROW_FROM_LEFT

Since: API Level

Grow from left.

Constant Value: 1 (0x00000001)

public static final int ANIM_GROW_FROM_RIGHT

Since: API Level

Grow from right.

Constant Value: 2 (0x00000002)

public static final int ANIM_NONE

Since: API Level

No animation.

Constant Value: 0 (0x00000000)

Public Constructors

public QuickActionBar (Context context)

Since: API Level 2.5

Public Methods

public ActionInterfaces.Layout.ActionLayoutInterface beginLayout ()

Since: API Level

Begins the layout process to define the ActionInterfaces.Item.ActionItem that should be hosted by this action container.

Important: When you finish adding the ActionInterfaces.Item.ActionItem to the container, you need to call the endLayout() to end the layout process.

public void dismiss ()

Since: API Level

Dispose of the popup window. If the popup window has not been shown, calling this method will have no effect.

public boolean isShowing ()

Since: API Level

Indicates whether the popup window is showing on screen.

Returns
  • true if the popup is showing, false otherwise

public void onEndLayout (ActionInterfaces.Layout.ActionLayoutInterface layout)

Since: API Level

Called when the layout process has ended (for internal use only, you normally don't need to call/override this method).

public void setAnimateTrack (boolean animateTrack)

Since: API Level 2.5

Sets whether to animate the track.

Parameters
animateTrack If true, the track will be animated.

public void setAnimationStyle (int animStyle)

Since: API Level

Sets the style of the window animation.

Parameters
animStyle The style resource id.

public void setBackgroundDrawable (Drawable background)

Since: API Level

Sets the background to a given Drawable, or remove the background.

Parameters
background The Drawable to use as the background, or null to remove the background.

public void setDismissOnClick (boolean dismiss)

Since: API Level

Sets whether to dismiss the window when the user click on an action item.

Parameters
dismiss If true, dismiss the window after the click.

public void setDismissOnClick (boolean dismiss, int delay)

Since: API Level

Sets whether to dismiss the window when the user click on an action item.

Parameters
dismiss If true, dismiss the window after the click.
delay Delay time (in millisecond) before dismissing the window.

public void setOnDismissListener (PopupWindow.OnDismissListener listener)

Since: API Level

Sets the listener to be notified when the window is dismissed.

Parameters
listener The listener to be notified.

public void setTitle (String title)

Since: API Level

Sets the title of the window.

Parameters
title The title of the window. This can be null, to hide the title.

public void show (View parent, int targetXPos, int targetYPos)

Since: API Level

Display the content view in a popup window at the specified location.

Parameters
parent a parent view to get the getWindowToken() token from
targetXPos the popup x location. This should be a raw value. See MotionEvent.getRawX().
targetYPos the popup y location. This should be a raw value. See MotionEvent.getRawY().

public void show (View anchor)

Since: API Level

Display the content view in a popup window anchored to the anchor view. The popup window can be displayed above or below the anchor view depends on the available space that can contain the window size.

Parameters
anchor The view which the window will be anchored to.

Protected Methods

protected abstract void createActionViews ()

Since: API Level

protected abstract int getContentLayoutId ()

Since: API Level