public final class Basket extends ServiceConnector implements IBasket
ServiceConnector.InternalServiceConnection
ACTION_BIND_V2, SERVICES_PACKAGE
Modifier and Type | Method and Description |
---|---|
static IBasket |
getInstance(android.content.Context context)
Return a global instance of Basket, which is the default implementation of
IBasket , and instantiate it if needed. |
protected java.lang.String |
getServiceName()
Must be overrided to provide service class name used for binding.
|
void |
hide()
Hide basket screen.
|
protected void |
onServiceReady(android.os.IBinder service)
Internal callback when service is connected.
|
protected void |
onServiceUnbinded()
Internal callback when service is disconnected.
|
void |
registerValidationListener(IBasketValidationListener listener)
Register a new listener to retrieve basket validation events.
|
void |
requestCustomerValidation()
(not yet implemented)
Ask validation on the customer screen.
|
void |
setContent(BasketContent basketContent)
Set basket content to display on the customer screen.
|
void |
show()
Display basket screen.
|
void |
unregisterValidationListener(IBasketValidationListener listener)
Unregister a listener.
|
connect, connectSync, disconnect, ensureServiceIsReady, getBindIntent, getContext, isConnected
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, disconnect, isConnected
public static IBasket getInstance(android.content.Context context)
IBasket
, and instantiate it if needed.
Be aware that only one instance will be created for the whole application, so the associated
context should not be a component which could be destroyed at some point, ie. an Activity.
Passing the Application
to this method is preferred over other context types.
context
- A valid context to initialize the instance.public void show() throws IngenicoException
show
in interface IBasket
IngenicoException
public void hide() throws IngenicoException
hide
in interface IBasket
IngenicoException
public void setContent(BasketContent basketContent) throws IngenicoException
setContent
in interface IBasket
basketContent
- contentIngenicoException
public void requestCustomerValidation()
requestCustomerValidation
in interface IBasket
public void registerValidationListener(IBasketValidationListener listener)
IBasket
registerValidationListener
in interface IBasket
public void unregisterValidationListener(IBasketValidationListener listener)
unregisterValidationListener
in interface IBasket
protected java.lang.String getServiceName()
ServiceConnector
getServiceName
in class ServiceConnector
protected void onServiceReady(android.os.IBinder service)
ServiceConnector
onServiceReady
in class ServiceConnector
protected void onServiceUnbinded()
ServiceConnector
onServiceUnbinded
in class ServiceConnector