HighscoreCustomFragment

com.j0h1.contour

## Class HighscoreCustomFragment

- java.lang.Object
- - Fragment
  - - com.j0h1.contour.HighscoreCustomFragment

-     public class HighscoreCustomFragment
      extends Fragment

  Fragment that is responsible for displaying the top 10 custom sessions.
  Author:
    Johannes Riedmann

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.util.ArrayList<Session>` | `customSessions`
    `private ListView` | `lvHighscoresCustom`
    `private Toast` | `toast`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HighscoreCustomFragment()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private Player` | `getLocalPlayer()` Gets the locally persisted player from the database.
    `View` | `onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)`
    `void` | `onStart()`
    `private void` | `populateListView(Player player)` Fills the ListView with custom session data of the local player received from the REST request.
    `private void` | `prepareToast(java.lang.String message)`
    `private void` | `requestCustomSessionData()` Request custom session data for the local player.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### customSessions

          private java.util.ArrayList<Session> customSessions

    - #### lvHighscoresCustom

          private ListView lvHighscoresCustom

    - #### toast

          private Toast toast

  - ### Constructor Detail

    - #### HighscoreCustomFragment

          public HighscoreCustomFragment()

  - ### Method Detail

    - #### onStart

          public void onStart()

    - #### onCreateView

          public View onCreateView(LayoutInflater inflater,
                                   ViewGroup container,
                                   Bundle savedInstanceState)

    - #### requestCustomSessionData

          private void requestCustomSessionData()

      Request custom session data for the local player. If there are custom sessions persisted server-sided, then populate the ListView with the meta data of the sessions.

    - #### populateListView

          private void populateListView(Player player)

      Fills the ListView with custom session data of the local player received from the REST request.
      Parameters:
        `player` - Locally persisted player.

    - #### getLocalPlayer

          private Player getLocalPlayer()

      Gets the locally persisted player from the database.
      Returns:
        Locally persisted player.

    - #### prepareToast

          private void prepareToast(java.lang.String message)