我有一个订阅者按钮的动态列表,每个按钮都有几个与订阅者相关联的动态生成的卡类型按钮。在我的订阅者按钮 onClick 中,我想显示(或隐藏)卡片类型按钮,但在弄清楚如何将卡片组与特定订阅者关联时遇到了问题。到目前为止,这是我的 Onclick 中的内容:
View.OnClickListener getSubscriberOnClick(final IdCardSubscriberButton subscriberButton) {
return new View.OnClickListener() {
public void onClick(View v) {
Drawable icon;
if(subscriberButton.isExpanded() == false) {
icon = getResources().getDrawable(R.drawable.ic_id_card_close);
subscriberButton.setExpanded(true);
//Here's where I need to display the card Type buttons. How do I associate the
//card type buttons with this particular subscriber button?
} else {
icon = getResources().getDrawable(R.drawable.ic_id_card_dropdown);
subscriberButton.setExpanded(false);
}
subscriberButton.setCompoundDrawablesWithIntrinsicBounds(null,null,icon,null);
}
};
}
任何帮助,将不胜感激。