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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?