Class SessionViewModel

java.lang.Object
androidx.lifecycle.ViewModel
com.example.breeze_seas.SessionViewModel

public class SessionViewModel extends androidx.lifecycle.ViewModel
This class allows data to be shared between different fragments
  • Constructor Details

    • SessionViewModel

      public SessionViewModel()
  • Method Details

    • getAndroidID

      public androidx.lifecycle.MutableLiveData<String> getAndroidID()
      Returns the current android ID
      Returns:
      String of current device AndroidID
    • setAndroidID

      public void setAndroidID(String id)
      Set android ID
      Parameters:
      id - The id to set the Android ID as
    • getUser

      public androidx.lifecycle.MutableLiveData<User> getUser()
      Return the curernt user object
      Returns:
      The user object to set as current user
    • setUser

      public void setUser(User userInstance)
      Set the current user object
      Parameters:
      userInstance - The user object pertaining to the current user
    • getEventShown

      public androidx.lifecycle.MutableLiveData<Event> getEventShown()
      Gets the event object that will be presented in the EventDetails Fragment
      Returns:
      The event object to be displayed
    • setEventShown

      public void setEventShown(Event eventShown)
      Sets the event object for EventDetailsFragment to display
      Parameters:
      eventShown - The event object to show