Back to project page GhostStories.
The source code is released under:
GNU General Public License
If you think the Android project GhostStories listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package games.ghoststories.views.common; /* w w w.j ava 2 s . c o m*/ import games.ghoststories.data.TokenSupplyData; import android.content.Context; import android.util.AttributeSet; /** * View representing a stack of qi tokens. */ public class QiTokenView extends AbstractNumberedTokenView { /** * Constructor * @param pContext The context the view is running in */ public QiTokenView(Context pContext) { super(pContext); } /** * Constructor * @param pContext The context the view is running in * @param pAttrs The attributes of this view */ public QiTokenView(Context pContext, AttributeSet pAttrs) { this(pContext, pAttrs, 0); } /** * Constructor * @param pContext The context the view is running in * @param pAttrs The attributes of this view * @param pDefStyle The default style applied to this view */ public QiTokenView(Context pContext, AttributeSet pAttrs, int pDefStyle) { super(pContext, pAttrs, pDefStyle); } /* * (non-Javadoc) * @see games.ghoststories.data.interfaces.ITokenListener#tokenDataUpdated() */ public void tokenDataUpdated() { int numTokens = mData.getNumQi(); if(numTokens != getNumber()) { setNumber(numTokens); } } /* * (non-Javadoc) * @see games.ghoststories.views.common.AbstractNumberedTokenView#setData(games.ghoststories.data.TokenSupplyData) */ @Override public void setData(TokenSupplyData pData) { super.setData(pData); setNumber(pData.getNumQi()); } }