Class LoginViewModel

    • Constructor Detail

      • LoginViewModel

        public LoginViewModel​(@NonNull
                              Application application)
        Constructor for class. Instantiates local variables and causes a silent refresh if necessary.
        Parameters:
        application - an application
    • Method Detail

      • refresh

        public void refresh()
        Interacts with the GoogleSignInRepository to refresh user credentials from the cloud. If the refresh fails, it does not get reported as an error; The user has to log in again.
      • startSignIn

        public void startSignIn​(androidx.activity.result.ActivityResultLauncher<Intent> launcher)
        Interacts with the GoogleSignInRepository to begins the application sign in process.
        Parameters:
        launcher - an ActivityResultLauncher object of type Intent.
      • completeSignIn

        public void completeSignIn​(androidx.activity.result.ActivityResult result)
        Interacts with the GoogleSignInRepository to sign a user into the application.
        Parameters:
        result - the result of the SignIn process
      • signOut

        public void signOut()
        Interacts with the GoogleSignInRepository to sign the User out of their Google account.