Mavericks

Mavericks: 自动驾驶的安卓系统。「MvRx: Android on Autopilot」

Github星跟踪图

MvRx: Android on Autopilot

For full documentation, check out the wiki

MvRx (pronounced mavericks) is the Android framework from Airbnb that we use for nearly all product development at Airbnb.

When we began creating MvRx, 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 MvRx 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") : MvRxState

/**
 * Refer to the wiki for how to set up your base ViewModel.
 */
class HelloWorldViewModel(initialState: HelloWorldState) : MyBaseMvRxViewModel<HelloWorldState>(initialState, debugMode = BuildConfig.DEBUG) {
    fun getMoreExcited() = setState { copy(title = "$title!") }
}

class HelloWorldFragment : BaseFragment() {
    private val viewModel: HelloWorldViewModel by fragmentViewModel()

    override fun EpoxyController.buildModels() = withState(viewModel) { state ->
        header {
            title(state.title)
        }
        basicRow { 
            onClick { viewModel.getMoreExcited() }
        }
    }
}

Installation

Gradle is the only supported build configuration, so just add the dependency to your project build.gradle file:

dependencies {
  implementation 'com.airbnb.android:mvrx:x.y.z'
}

The latest version of mvrx is Maven Central

For full documentation, check out the wiki

主要指标

概览
名称与所有者airbnb/mavericks
主编程语言Kotlin
编程语言Kotlin (语言数: 3)
平台
许可证Apache License 2.0
所有者活动
创建于2018-07-03 06:11:45
推送于2025-10-17 00:58:10
最后一次提交
发布数47
最新版本名称v3.0.12 (发布于 2025-10-17 00:57:39)
第一版名称v0.0.5 (发布于 )
用户参与
星数5.9k
关注者数99
派生数509
提交数390
已启用问题?
问题数363
打开的问题数56
拉请求数308
打开的拉请求数6
关闭的拉请求数49
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?