Package icyllis.modernui.lifecycle

# Interface ViewModelStoreOwner

All Known Implementing Classes:
  `Fragment`, `TestFragment`, `TestFragment.FragmentA`, `TestFragment.FragmentB`

public interface ViewModelStoreOwner
A scope that owns `ViewModelStore`.

A responsibility of an implementation of this interface is to retain owned ViewModelStore during the configuration changes and call `ViewModelStore.clear()`, when this scope is going to be destroyed.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default ViewModelProvider.Factory`
  `getDefaultViewModelProviderFactory()`
  Returns the default `ViewModelProvider.Factory` that should be used when no custom `Factory` is provided to the `ViewModelProvider` constructors, such as `ViewModelProvider(ViewModelStoreOwner)`.
  `ViewModelStore`
  `getViewModelStore()`
  Returns the `ViewModelStore` of the provider.

- ## Method Details

  - ### getViewModelStore

    @Nonnull ViewModelStore getViewModelStore()
    Returns the `ViewModelStore` of the provider.
    Returns:
      a `ViewModelStore`

  - ### getDefaultViewModelProviderFactory

    default ViewModelProvider.Factory getDefaultViewModelProviderFactory()
    Returns the default `ViewModelProvider.Factory` that should be used when no custom `Factory` is provided to the `ViewModelProvider` constructors, such as `ViewModelProvider(ViewModelStoreOwner)`.
    Returns:
      a `ViewModelProvider.Factory`