Class FriendsPresenter<T extends FriendsView>

  • All Implemented Interfaces:
    com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<T>

    public class FriendsPresenter<T extends FriendsView>
    extends com.cheetahdigital.uikit.widget.list.ListPresenter<T>
    The MvpPresenter class for FriendsFragment
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connectToFacebook​(java.lang.String facebookToken)
      Attempt to connect to facebook
      void connectToFacebook​(java.lang.String facebookToken, com.cheetahdigital.profile.core.api.ProfileParams profileParams, com.cheetahdigital.profile.core.api.ProfileFields profileFields)
      Attempt to connect to facebook
      protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getConnectListener()
      Create a listener for FriendsAPI
      protected FriendsAPI getFriendsAPI()
      Get current instance of FriendsAPI
      protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<java.util.List<Friend>>,​java.util.List<Friend>> getFriendsReceivedListener()
      Create a listener for FriendsAPI
      protected com.cheetahdigital.profile.core.api.ProfileAPI getProfileAPI()
      Get current instance of ProfileAPI
      void loadData()
      Load initial view data.
      void refreshData()
      Start the refresh view data.
      protected void showFriendFailed()
      Called after a failed Friend request
      protected void showFriendSuccess​(java.util.List<Friend> friends)
      Called after a successful Friend request
      • Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter

        isRefreshing, onRefreshFailed, onRefreshSuccess
      • Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter

        onLoadFailed, onLoadSuccess
      • Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter

        attachView, detachView, getView
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FriendsPresenter

        public FriendsPresenter​(@NonNull
                                java.lang.String leaderboardName)
        Create the presenter with a leaderboard name
        Parameters:
        leaderboardName - the leaderboard name to use
      • FriendsPresenter

        public FriendsPresenter​(@NonNull
                                java.lang.String leaderboardName,
                                FriendsParams friendsParams)
        Create the presenter with a given FriendsParams
        Parameters:
        leaderboardName - name for the leaderboard
        friendsParams - the FriendsParams
    • Method Detail

      • getFriendsReceivedListener

        protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<java.util.List<Friend>>,​java.util.List<Friend>> getFriendsReceivedListener()
        Create a listener for FriendsAPI
        Returns:
        listener to handle FriendsAPI requests
      • getConnectListener

        protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getConnectListener()
        Create a listener for FriendsAPI
        Returns:
        listener to handle FriendsAPI requests
      • getProfileAPI

        protected com.cheetahdigital.profile.core.api.ProfileAPI getProfileAPI()
        Get current instance of ProfileAPI
        Returns:
        ProfileAPI used on this presenter
      • refreshData

        public void refreshData()
        Description copied from class: com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
        Start the refresh view data.
        Overrides:
        refreshData in class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<T extends FriendsView>
      • loadData

        public void loadData()
        Description copied from class: com.cheetahdigital.uikit.architecture.lce.LcePresenter
        Load initial view data.
        Specified by:
        loadData in class com.cheetahdigital.uikit.architecture.lce.LcePresenter<T extends FriendsView>
      • connectToFacebook

        public void connectToFacebook​(java.lang.String facebookToken)
        Attempt to connect to facebook
        Parameters:
        facebookToken - token generated by facebook
      • connectToFacebook

        public void connectToFacebook​(java.lang.String facebookToken,
                                      com.cheetahdigital.profile.core.api.ProfileParams profileParams,
                                      com.cheetahdigital.profile.core.api.ProfileFields profileFields)
        Attempt to connect to facebook
        Parameters:
        facebookToken - token generated by facebook
        profileParams - ProfileParams to use for connecting request
        profileFields - ProfileFields to use for connecting request
      • showFriendSuccess

        protected void showFriendSuccess​(java.util.List<Friend> friends)
        Called after a successful Friend request
        Parameters:
        friends - response received in Friend format
      • showFriendFailed

        protected void showFriendFailed()
        Called after a failed Friend request