From 9c1e84939d36d5e33611a57e913fcba56ce32958 Mon Sep 17 00:00:00 2001 From: Vivien Mahe Date: Thu, 7 Jul 2011 12:05:57 +0200 Subject: [PATCH] Added QuickActionWidget's anchor tag, usefull if you have one QuickActionWidget by item in a ListView --- .../greendroid/widget/QuickActionWidget.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/GreenDroid/src/greendroid/widget/QuickActionWidget.java b/GreenDroid/src/greendroid/widget/QuickActionWidget.java index febc4d9..c077959 100644 --- a/GreenDroid/src/greendroid/widget/QuickActionWidget.java +++ b/GreenDroid/src/greendroid/widget/QuickActionWidget.java @@ -64,6 +64,8 @@ public abstract class QuickActionWidget extends PopupWindow { private OnQuickActionClickListener mOnQuickActionClickListener; private ArrayList mQuickActions = new ArrayList(); + private Object anchorTag; + /** * Interface that may be used to listen to clicks on quick actions. * @@ -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 */ @@ -239,6 +259,7 @@ public void show(View anchor) { + " setWidgetSpecs()"); } + setAnchorTag(anchor.getTag()); showArrow(); prepareAnimationStyle(); showAtLocation(anchor, Gravity.NO_GRAVITY, 0, mPopupY);