Class EventDetailsPresenter<T extends EventDetailsView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.uikit.architecture.lce.LcePresenter<T>
-
- com.cheetahdigital.event.ui.detail.EventDetailsPresenter<T>
-
- Type Parameters:
T
- theEventDetailsView
class
- All Implemented Interfaces:
com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<T>
public class EventDetailsPresenter<T extends EventDetailsView> extends com.cheetahdigital.uikit.architecture.lce.LcePresenter<T>
TheLcePresenter
class forEventDetailsActivity
-
-
Constructor Summary
Constructors Constructor Description EventDetailsPresenter(java.lang.String eventId)
Constructor forEventDetailsPresenter
EventDetailsPresenter(java.lang.String eventId, EventsParams eventsParams)
Constructor forEventDetailsPresenter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Event>,Event>
getEventReceivedListener()
Create a listener forEventsAPI
protected EventsAPI
getEventsAPI()
Get current instance ofEventsAPI
protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse>
getRespondListener()
Create a listener forEventsAPI
void
loadData()
Load initial view data.protected void
onEventDownloadFailed(java.lang.String error)
Called after a failed request for fetching eventprotected void
onEventDownloadSuccess(Event event)
Called upon receiving a successful call on fetching an eventvoid
onLoadFailed(java.lang.String error)
Show the error viewprotected void
onRespondFailed(java.lang.String error)
Called after a failed respondprotected void
onRespondSuccess(com.cheetahdigital.corekit.models.responses.SuccessResponse data)
Called after a successful respond to eventvoid
respondToEvent(java.lang.String latLongJSONRaw)
Respond to the current eventvoid
respondToEvent(java.lang.String latLongJSONRaw, EventsParams eventsParams)
Respond to the current event
-
-
-
Constructor Detail
-
EventDetailsPresenter
public EventDetailsPresenter(java.lang.String eventId)
Constructor forEventDetailsPresenter
- Parameters:
eventId
- id of the event
-
EventDetailsPresenter
public EventDetailsPresenter(java.lang.String eventId, EventsParams eventsParams)
Constructor forEventDetailsPresenter
- Parameters:
eventId
- id of the eventeventsParams
- theEventsParams
-
-
Method Detail
-
getRespondListener
protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getRespondListener()
Create a listener forEventsAPI
- Returns:
- listener to handle
EventsAPI
requests
-
getEventReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Event>,Event> getEventReceivedListener()
Create a listener forEventsAPI
- Returns:
- listener to handle
EventsAPI
requests
-
getEventsAPI
protected EventsAPI getEventsAPI()
Get current instance ofEventsAPI
- Returns:
EventsAPI
used on this presenter
-
loadData
public void loadData()
Description copied from class:com.cheetahdigital.uikit.architecture.lce.LcePresenter
Load initial view data.- Specified by:
loadData
in classcom.cheetahdigital.uikit.architecture.lce.LcePresenter<T extends EventDetailsView>
-
respondToEvent
public void respondToEvent(java.lang.String latLongJSONRaw)
Respond to the current event- Parameters:
latLongJSONRaw
- long lat to be added in header
-
respondToEvent
public void respondToEvent(java.lang.String latLongJSONRaw, EventsParams eventsParams)
Respond to the current event- Parameters:
latLongJSONRaw
- long lat to be added in headereventsParams
-EventsParams
to use for responding
-
onEventDownloadSuccess
protected void onEventDownloadSuccess(Event event)
Called upon receiving a successful call on fetching an event- Parameters:
event
- received response parse inEvent
-
onEventDownloadFailed
protected void onEventDownloadFailed(java.lang.String error)
Called after a failed request for fetching event- Parameters:
error
- detail of the error
-
onRespondSuccess
protected void onRespondSuccess(com.cheetahdigital.corekit.models.responses.SuccessResponse data)
Called after a successful respond to event- Parameters:
data
- response received
-
onRespondFailed
protected void onRespondFailed(java.lang.String error)
Called after a failed respond- Parameters:
error
- detail of the error
-
onLoadFailed
public void onLoadFailed(java.lang.String error)
Description copied from class:com.cheetahdigital.uikit.architecture.lce.LcePresenter
Show the error view- Overrides:
onLoadFailed
in classcom.cheetahdigital.uikit.architecture.lce.LcePresenter<T extends EventDetailsView>
- Parameters:
error
- message detailing the error
-
-