docs/setup.md
Adding Mavericks to your app requires just three steps:
dependencies {
implementation 'com.airbnb.android:mavericks:x.y.z'
}
The latest version of Mavericks is
Make your base Fragment class implement MavericksView.
MavericksView is just an interface so you can compose it with your existing base Fragment.
MavericksView can be implemented on any LifecycleOwner so you may create your own view constructs if you don't want to use Fragments.
In your Application onCreate method, add a single line:
Mavericks.initialize(this)
If you plan to use Mavericks Mocking, use this line instead:
MockableMavericks.initialize(this)
If you plan on using Jetpack Navigation, you should also follow the setup steps at here.
Mavericks lets you override some configuration that is used every time a new ViewModel is created. For example, you could change the default dispatcher for the state store or for subscriptions. Check out the docs for ViewModelConfigFactory for more info.
Note: If you create your own config factory, ensure that you set debugMode correctly so that the debug checks are run.
To use a custom config, add this parameter to your Mavericks.initialize() call:
viewModelConfigFactory = MavericksViewModelConfigFactory(applicationContext)