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- theEventDetailsViewclass
- All Implemented Interfaces:
MvpPresenter<T>
public class EventDetailsPresenter<T extends EventDetailsView> extends LcePresenter<T>
TheLcePresenterclass forEventDetailsActivity
-
-
Constructor Summary
Constructors Constructor Description EventDetailsPresenter(java.lang.String eventId)Constructor forEventDetailsPresenterEventDetailsPresenter(java.lang.String eventId, EventsParams eventsParams)Constructor forEventDetailsPresenter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ListenerModel<BaseModel<Event>,Event>getEventReceivedListener()Create a listener forEventsAPIprotected EventsAPIgetEventsAPI()Get current instance ofEventsAPIprotected Listener<SuccessResponse>getRespondListener()Create a listener forEventsAPIvoidloadData()Load initial view data.protected voidonEventDownloadFailed(java.lang.String error)Called after a failed request for fetching eventprotected voidonEventDownloadSuccess(Event event)Called upon receiving a successful call on fetching an eventvoidonLoadFailed(java.lang.String error)Show the error viewprotected voidonRespondFailed(java.lang.String error)Called after a failed respondprotected voidonRespondSuccess(SuccessResponse data)Called after a successful respond to eventvoidrespondToEvent(java.lang.String latLongJSONRaw)Respond to the current eventvoidrespondToEvent(java.lang.String latLongJSONRaw, EventsParams eventsParams)Respond to the current event-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter
onLoadSuccess
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
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 Listener<SuccessResponse> getRespondListener()
Create a listener forEventsAPI- Returns:
- listener to handle
EventsAPIrequests
-
getEventReceivedListener
protected ListenerModel<BaseModel<Event>,Event> getEventReceivedListener()
Create a listener forEventsAPI- Returns:
- listener to handle
EventsAPIrequests
-
getEventsAPI
protected EventsAPI getEventsAPI()
Get current instance ofEventsAPI- Returns:
EventsAPIused on this presenter
-
loadData
public void loadData()
Description copied from class:LcePresenterLoad initial view data.- Specified by:
loadDatain classLcePresenter<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-EventsParamsto 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(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:LcePresenterShow the error view- Overrides:
onLoadFailedin classLcePresenter<T extends EventDetailsView>- Parameters:
error- message detailing the error
-
-