Class BaseViewModel

  • All Implemented Interfaces:

    
    public class BaseViewModel
    extends ViewModel
                        

    Base ViewModel providing error event LiveData.

    Since:

    5.10.4

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected abstract class BaseViewModel.SafeDataHandler

      Safe data handler that processes data changes and errors.

    • Constructor Summary

      Constructors 
      Constructor Description
      BaseViewModel(Bundle bundle)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Bundle getArguments()
      MutableLiveData<ErrorEvent<NCError>> getErrorEventLiveData() Returns the error event LiveData for observing error states.
      void postErrorEvent(ErrorEvent<NCError> errorEvent) Posts a page-level error event.
      • Methods inherited from class androidx.lifecycle.ViewModel

        addCloseable, onCleared
      • Methods inherited from class java.lang.Object

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

      • BaseViewModel

        BaseViewModel(Bundle bundle)
    • Method Detail

      • getErrorEventLiveData

         MutableLiveData<ErrorEvent<NCError>> getErrorEventLiveData()

        Returns the error event LiveData for observing error states.

        Returns:

        MutableLiveData

      • postErrorEvent

         void postErrorEvent(ErrorEvent<NCError> errorEvent)

        Posts a page-level error event.

        Parameters:
        errorEvent - the error event