Package com.cheetahdigital.event.ui.list
Class EventListPresenter<T extends EventListView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.uikit.architecture.lce.LcePresenter<V>
-
- com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<V>
-
- com.cheetahdigital.uikit.widget.list.ListPresenter<V>
-
- com.cheetahdigital.uikit.widget.list.EndlessListPresenter<T>
-
- com.cheetahdigital.event.ui.list.EventListPresenter<T>
-
- Type Parameters:
T
- theEventListView
class
- All Implemented Interfaces:
com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<T>
public class EventListPresenter<T extends EventListView> extends com.cheetahdigital.uikit.widget.list.EndlessListPresenter<T>
TheEndlessListPresenter
class forEventListFragment
-
-
Constructor Summary
Constructors Constructor Description EventListPresenter()
Constructor forEventListPresenter
EventListPresenter(EventsParams eventsParams)
Constructor forEventListPresenter
-
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<EventCategories>,EventCategories>
getEventCategoriesReceivedListener()
Create a listener forEventsAPI
protected EventsAPI
getEventsAPI()
Get current instance ofEventsAPI
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Events>,Events>
getEventsReceivedListener()
Create a listener forEventsAPI
java.lang.String
getSelectedCategory()
Get the current value for selected categoryvoid
loadData()
Load initial view data.void
loadMore(int currentPage)
protected void
onEventCategoriesDownloadSuccess(EventCategories data)
Called after a successful event category requestvoid
onLoadMoreSuccess(com.cheetahdigital.corekit.models.data.BaseData data)
End of load more with success requestvoid
onRefreshSuccess(com.cheetahdigital.corekit.models.data.BaseData data)
End of refresh with success request.void
refreshData()
Start the refresh view data.void
setEventCategoryParams(EventsParams eventCategoryParams)
Set the category params for fetching list of categoryvoid
setFilterEnabled(boolean isFilterEnabled)
Set enabling of filtervoid
updateSelectedCategory(int position)
Update selected category-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListPresenter
isAppending, onLoadMoreFailed
-
Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
isRefreshing, onRefreshFailed
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter
onLoadFailed, onLoadSuccess
-
-
-
-
Constructor Detail
-
EventListPresenter
public EventListPresenter()
Constructor forEventListPresenter
-
EventListPresenter
public EventListPresenter(EventsParams eventsParams)
Constructor forEventListPresenter
- Parameters:
eventsParams
- instance ofEventsParams
that is used forEventsAPI
-
-
Method Detail
-
getEventsReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Events>,Events> getEventsReceivedListener()
Create a listener forEventsAPI
- Returns:
- listener to handle
EventsAPI
requests
-
getEventCategoriesReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<EventCategories>,EventCategories> getEventCategoriesReceivedListener()
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 EventListView>
-
loadMore
public void loadMore(int currentPage)
- Overrides:
loadMore
in classcom.cheetahdigital.uikit.widget.list.EndlessListPresenter<T extends EventListView>
-
onLoadMoreSuccess
public void onLoadMoreSuccess(com.cheetahdigital.corekit.models.data.BaseData data)
Description copied from class:com.cheetahdigital.uikit.widget.list.EndlessListPresenter
End of load more with success request- Overrides:
onLoadMoreSuccess
in classcom.cheetahdigital.uikit.widget.list.EndlessListPresenter<T extends EventListView>
- Parameters:
data
- instance ofBaseData
passed
-
onEventCategoriesDownloadSuccess
protected void onEventCategoriesDownloadSuccess(EventCategories data)
Called after a successful event category request- Parameters:
data
- received response inEventCategories
format
-
setFilterEnabled
public void setFilterEnabled(boolean isFilterEnabled)
Set enabling of filter- Parameters:
isFilterEnabled
-true
to enable category filtering, elsefalse
-
updateSelectedCategory
public void updateSelectedCategory(int position)
Update selected category- Parameters:
position
- index of the category from the current list
-
getSelectedCategory
public java.lang.String getSelectedCategory()
Get the current value for selected category- Returns:
- value of the selected category
-
setEventCategoryParams
public void setEventCategoryParams(@NonNull EventsParams eventCategoryParams)
Set the category params for fetching list of category- Parameters:
eventCategoryParams
- instance ofEventsParams
-
refreshData
public void refreshData()
Description copied from class:com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
Start the refresh view data.- Overrides:
refreshData
in classcom.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<T extends EventListView>
-
onRefreshSuccess
public void onRefreshSuccess(com.cheetahdigital.corekit.models.data.BaseData data)
Description copied from class:com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
End of refresh with success request.- Overrides:
onRefreshSuccess
in classcom.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<T extends EventListView>
- Parameters:
data
- theBaseData
.
-
-