Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added QuickActionWidget's anchor tag, usefull if you have one QuickAction #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions GreenDroid/src/greendroid/widget/QuickActionWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public abstract class QuickActionWidget extends PopupWindow {
private OnQuickActionClickListener mOnQuickActionClickListener;
private ArrayList<QuickAction> mQuickActions = new ArrayList<QuickAction>();

private Object anchorTag;

/**
* Interface that may be used to listen to clicks on quick actions.
*
Expand Down Expand Up @@ -174,6 +176,24 @@ public boolean getDismissOnClick() {
return mDismissOnClick;
}

/**
* Sets the tag of the widget's anchor
*
* @param The tag of the widget's anchor
*/
public void setAnchorTag(final Object anchorTag) {
this.anchorTag = anchorTag;
}

/**
* Sets the tag of the widget's anchor
*
* @return The tag of the widget's anchor
*/
public Object getAnchorTag() {
return anchorTag;
}

/**
* @param listener
*/
Expand Down Expand Up @@ -239,6 +259,7 @@ public void show(View anchor) {
+ " setWidgetSpecs()");
}

setAnchorTag(anchor.getTag());
showArrow();
prepareAnimationStyle();
showAtLocation(anchor, Gravity.NO_GRAVITY, 0, mPopupY);
Expand Down