CubeCard
Updated at:
Introduction
The core class for managing card rendering, data updates, lifecycle states, and resource cleanup.
Methods
renderView
/**
* Renders a view. A CubeView object is required.
* @param view The CubeView object generated by CubeEngine.
*/
public void renderView(CubeView view)
getSize
/**
* Gets the width and height of the card.
* @return Rect An object that contains the width and height of the card.
*/
public Rect getSize()
updateData
/**
* Updates the rendering data.
* @param jsonData The external data model required for cube rendering.
*/
public void updateData(JSONObject jsonData)
callJsFunction
/**
* Calls a JS method.
* @param methodName The method name.
* @param params The call parameters.
*/
public void callJsFunction(final String methodName, final Object... params)
recycle
/**
* Destroys the card and releases its resources.
*/
public void recycle()
getCardUid
/**
* Gets the card instance ID.
* @return The card instance ID.
*/
public String getCardUid()
notifyState
/**
* Notifies the card of a state change when it appears on, disappears from, or moves between the foreground and background.
* @param state The card state.
*/
public void notifyState(CCardState state)
getCubeCardConfig
/**
* Gets the config parameter used to create the card.
* @return The config object used to create the card.
*/
public CubeCardConfig getCubeCardConfig()
getBindView
/**
* Gets the view temporarily attached to the card. The view can be reused by other cards.
* @return The attached view.
*/
public CubeView getBindView()
Is this page helpful?