Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/airbnb/mavericks
Mavericks: Android on Autopilot
https://github.com/airbnb/mavericks
Last synced: about 24 hours ago
JSON representation
Mavericks: Android on Autopilot
- Host: GitHub
- URL: https://github.com/airbnb/mavericks
- Owner: airbnb
- License: apache-2.0
- Created: 2018-07-02T22:11:45.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-28T16:37:09.000Z (5 months ago)
- Last Synced: 2024-10-29T15:06:04.022Z (3 months ago)
- Language: Kotlin
- Homepage: https://airbnb.io/mavericks/
- Size: 36.9 MB
- Stars: 5,841
- Watchers: 102
- Forks: 498
- Open Issues: 61
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kotlin - mavericks - Mavericks: Android on Autopilot (Libraries)
- awesome-list - mavericks
README
[![Build Status](https://github.com/airbnb/mavericks/actions/workflows/build_test.yml/badge.svg)](https://github.com/airbnb/mavericks/actions/workflows/build_test.yml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.airbnb.android/mavericks/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.airbnb.android/mavericks)
[![codecov.io](https://codecov.io/github/codecov/mavericks/branch/main/graph/badge.svg)](https://codecov.io/github/codecov/mavericks)# Mavericks (formerly MvRx): Android on Autopilot
## For full documentation, check out our [docs site](https://airbnb.io/mavericks).
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:
```kotlindata 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 [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.airbnb.android/mavericks/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.airbnb.android/mavericks)## For full documentation, check out the [docs site](https://airbnb.io/mavericks)
Legacy documentation for MvRx 1.x can still be found in the [wiki](https://github.com/airbnb/mavericks/wiki)