Class UserViewModel

    • Constructor Detail

      • UserViewModel

        public UserViewModel​(Application application)
        The constructor initializes the MutableLiveData used in the viewmodel.
        Parameters:
        application - The current application.
    • Method Detail

      • getGenre

        public LiveData<User.Genre> getGenre()
        Returns LiveData of the user's current genre.
        Returns:
        LiveData of the user's current genre.
      • getUser

        public LiveData<User> getUser()
        Returns LiveData of the current user.
        Returns:
        LiveData of the current user.
      • saveGenre

        public void saveGenre​(User.Genre genre)
        Saves a genre for the current user.
        Parameters:
        genre - The genre to be saved.
      • loadUser

        public void loadUser()
        Loads a user from the server.