๐Ÿ“ฆ airbnb / mavericks

Mavericks: Android on Autopilot

โ˜… 5.9k stars โ‘‚ 510 forks ๐Ÿ‘ 5.9k watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/airbnb/mavericks.git
HTTPS git clone https://github.com/airbnb/mavericks.git
SSH git clone git@github.com:airbnb/mavericks.git
CLI gh repo clone airbnb/mavericks
Sebastian Gamboa Sebastian Gamboa Create CNAME be1c221 2 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ .idea
๐Ÿ“ docs
๐Ÿ“ gradle
๐Ÿ“ libs
๐Ÿ“ mock_generation
๐Ÿ“ mvrx
๐Ÿ“ mvrx-common
๐Ÿ“ mvrx-compose
๐Ÿ“ mvrx-hilt
๐Ÿ“ mvrx-launcher
๐Ÿ“ mvrx-mocking
๐Ÿ“ mvrx-navigation
๐Ÿ“ mvrx-rxjava2
๐Ÿ“ mvrx-testing
๐Ÿ“ projectFilesBackup
๐Ÿ“ sample
๐Ÿ“ sample-anvil
๐Ÿ“ sample-compose
๐Ÿ“ sample-counter
๐Ÿ“ sample-dagger
๐Ÿ“ sample-dogs
๐Ÿ“ sample-hilt
๐Ÿ“ sample-navigation
๐Ÿ“ sample-todo
๐Ÿ“ utils-view-binding
๐Ÿ“„ .gitignore
๐Ÿ“„ build.gradle
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ detekt.gradle
๐Ÿ“„ detekt.yml
๐Ÿ“„ gradle.properties
๐Ÿ“„ gradlew
๐Ÿ“„ gradlew.bat
๐Ÿ“„ LICENSE
๐Ÿ“„ lint.xml
๐Ÿ“„ README.md
๐Ÿ“„ RELEASING.md
๐Ÿ“„ settings.gradle
๐Ÿ“„ setup_hooks
๐Ÿ“„ README.md

Build Status Maven Central codecov.io

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:

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<HelloWorldState>(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:

dependencies {
  implementation 'com.airbnb.android:mavericks:x.y.z'
}
The latest version of mavericks is Maven Central

For full documentation, check out the docs site

Legacy documentation for MvRx 1.x can still be found in the wiki