SkillAgentSearch skills...

Corbind

⚡ Kotlin Coroutines binding APIs for Android UI widgets from the platform and support libraries

Install / Use

/learn @LDRAlighieri/Corbind

README

Corbind

Kotlin Version Kotlin Coroutines Version GitHub license

Codacy Badge API Publish status

Google Dev Library Android Weekly

<br>

⚡ Kotlin Coroutines binding APIs for Android UI widgets from the platform and support libraries. Supports Flow, ReceiveChannel and Actor.

Description

This library is for Android applications only. Help you to transform Android UI events into cold [Flow][flow], hot [ReceiveChannel][channel] or just perform an action through an [Actor][actor].
Please consider giving this repository a star ⭐ if you like the project.

Articles

  • [⚡ Kotlin Coroutine binding with Flow support][kotlin-coroutine-binding]
  • [What’s up Corbind! Release 1.7.0 🎉. It’s been a long road][release-1.7.0]

Current versions

| Module | Version | |------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [corbind-bom] | Maven Central | | [corbind] | Maven Central | | [corbind-activity] | Maven Central | | [corbind-appcompat] | Maven Central | | [corbind-core] | Maven Central | | [corbind-drawerlayout] | Maven Central | | [corbind-fragment] | Maven Central | | [corbind-leanback] | Maven Central | | [corbind-lifecycle] | Maven Central | | [corbind-material] | Maven Central | | [corbind-navigation] | Maven Central | | [corbind-recyclerview] | Maven Central | | [corbind-slidingpanelayout] | Maven Central | | [corbind-swiperefreshlayout] | Maven Central | | [corbind-viewpager] | Maven Central | | [corbind-viewpager2] | Maven Central |

Using in your projects

Platform bindings:

dependencies { 
    implementation(platform("ru.ldralighieri.corbind:corbind-bom:2026.02.00"))
    implementation("ru.ldralighieri.corbind:corbind")
}

AndroidX library bindings:

dependencies { 
    implementation(platform("ru.ldralighieri.corbind:corbind-bom:2026.02.00"))
    implementation("ru.ldralighieri.corbind:corbind-activity")
    implementation("ru.ldralighieri.corbind:corbind-appcompat")
    implementation("ru.ldralighieri.corbind:corbind-core")
    implementation("ru.ldralighieri.corbind:corbind-drawerlayout")
    implementation("ru.ldralighieri.corbind:corbind-fragment")
    implementation("ru.ldralighieri.corbind:corbind-leanback")
    implementation("ru.ldralighieri.corbind:corbind-lifecycle")
    implementation("ru.ldralighieri.corbind:corbind-navigation")
    implementation("ru.ldralighieri.corbind:corbind-recyclerview")
    implementation("ru.ldralighieri.corbind:corbind-slidingpanelayout")
    implementation("ru.ldralighieri.corbind:corbind-swiperefreshlayout")
    implementation("ru.ldralighieri.corbind:corbind-viewpager")
    implementation("ru.ldralighieri.corbind:corbind-viewpager2")
}

Google 'material' library bindings:

dependencies { 
    implementation(platform("ru.ldralighieri.corbind:corbind-bom:2026.02.00"))
    implementation("ru.ldralighieri.corbind:corbind-material")
}

Snapshot build:

repositories {
    maven("https://central.sonatype.com/repository/maven-snapshots/")
}

dependencies { 
    implementation(platform("ru.ldralighieri.corbind:corbind-bom:2026.03.00-SNAPSHOT"))
    implementation("ru.ldralighieri.corbind:{module}")
}

List of extensions

You can find a list of extensions in the description of each module:

  • [corbind]
  • [corbind-activity]
  • [corbind-appcompat]
  • [corbind-core]
  • [corbind-drawerlayout]
  • [corbind-fragment]
  • [corbind-leanback]
  • [corbind-lifecycle]
  • [corbind-material]
  • [corbind-navigation]
  • [corbind-recyclerview]
  • [corbind-slidingpanelayout]
  • [corbind-swiperefreshlayout]
  • [corbind-viewpager]
  • [corbind-viewpager2]

How to use it?

If you need to get a text change events of EditText widget, simple use case with cold [Flow][flow] will look something like this:

findViewById<EditText>(R.id.etName)
    .textChanges() // Flow<CharSequence>
    .onEach { /* handle text change events */ }
    .flowWithLifecycle(lifecycle)
    .launchIn(lifecycleScope) // lifecycle-runtime-ktx

If you prefer hot [ReceiveChannel][channel] and you need to get a ViewPager page selection events, then the use case will transform in something like this:

launch {
    findViewById<ViewPager>(R.id.vpSlides)
        .pageSelections(scope) // ReceiveChannel<Int>
        .consumeEach {
            /* handle ViewPager events */
        }
}

And if you just need to perform an action on button click, the easiest way will be:

launch {
    findViewById<AppCompatButton>(R.id.btConfirm)
        .clicks {
            /* perform an action on View click events */
        }
}

Just one more traditional example of login button enabling/disabling by email and password field validation:

combine(
    etEmail.textChanges() // Flow<CharSequence>
        .map { Patterns.EMAIL_ADDRESS.matcher(it).matches() },

    etPassword.textChanges() // Flow<CharSequence>
        .map { it.length > 7 },

    transform = { email, password -> email && password }
)
    .onEach { btLogin.isEnabled = it }
    .flowWithLifecycle(lifecycle)
    .launchIn(lifecycleScope) // lifecycle-runtime-ktx

More examples in module descriptions and in source code

Missed or forgot something?

If I forgot something or you have any ideas what can be added or corrected, please create an issue or contact me directly.

Special thanks to

[Jake Wharton][jw]. This project is inspired by [RxBinding][rx].

Licen

Related Skills

View on GitHub
GitHub Stars537
CategoryCustomer
Updated21h ago
Forks22

Languages

Kotlin

Security Score

100/100

Audited on Mar 31, 2026

No findings