airbnb /mavericks
Mavericks: Android on Autopilot
★ 5,923⑂ 507👁 99⑃ 371● 365▤ 39
More from this author
+0
Daily
5,923
stars
507
forks
99
watchers
371
prs
365
issues
39
releases
README
Mavericks (formerly MvRx): Android on Autopilot
For full documentation, check out our docs site.
Mavericks is the Android framework from Airbnb that we use for nearly all product development at Airbnb.
When we began creating Mavericks, our goal was not to create yet another architecture pattern for Airbnb, it was to make building products easier, faster, and more fun. All of our decisions have built on that. We believe that for Mavericks to be successful, it must be effective for building everything from the simplest of screens to the most complex in our app.
This is what it looks like:
kotlin
data class HelloWorldState(val title: String = "Hello World") : MavericksState
/
Refer to the wiki for how to set up your base ViewModel.
/
class HelloWorldViewModel(initialState: HelloWorldState) : MavericksViewModel(initialState) {
fun getMoreExcited() = setState { copy(title = "$title!") }
}
class HelloWorldFragment : Fragment(R.layout.hello_world_fragment), MavericksView {
private val viewModel: HelloWorldViewModel by fragmentViewModel()
override fun invalidate() = withState(viewModel) { state -
// Update your views with the latest state here.
// This will get called any time your state changes and the viewLifecycleOwner is STARTED.
}
}
Installation
Gradle is the only supported build configuration, so just add the dependency to your project build.gradle file:
groovy
dependencies {
implementation 'com.airbnb.android:mavericks:x.y.z'
}
The latest version of mavericks is
For full documentation, check out the docs site
Legacy documentation for MvRx 1.x can still be found in the wikiTop issues
#535[Proposal] Global error handler for execute functions22 comments · 2021-04-15#400How to handle one-shot events / side effects? Example: backwards navigation17 comments · 2020-05-17#115The best way to implement forms with MvRx & Epoxy16 comments · 2018-10-04#112MvRx at Airbnb utilities11 comments · 2018-10-04#613How to handle the result of Async when the ViewModel is destroyed9 comments · 2022-02-18#546Possibility to collect flow only when active subscribers are subscribed to state9 comments · 2021-05-05#352Add support for RxJava3?8 comments · 2020-02-20#705Discuss whenStarted function deprecation7 comments · 2023-12-18
Latest release
v3.1.1 v3.1.1 2026-09-25Commits - 7969ae2: Prepare for release 3.1.0 (737) (Eli Hart) 737 - 75bd356: Make the synchronous and mockable test state stores thread-safe (739) (Eli Hart) 739 - 18ae390: Prepare for release 3.1.1 (elihart) 740