# FlowBinding ![CI](https://github.com/ReactiveCircus/FlowBinding/workflows/Build/badge.svg) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.reactivecircus.flowbinding/flowbinding-android/badge.svg)](https://search.maven.org/search?q=g:io.github.reactivecircus.flowbinding) [![Android API](https://img.shields.io/badge/API-14%2B-blue.svg?label=API&maxAge=300)](https://www.android.com/history/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Kotlin Flow binding APIs for Android's platform and unbundled UI widgets, inspired by [RxBinding][rxbinding]. [Flow][flow] is (conceptually) a reactive streams implementation provided by the [kotlinx-coroutines-core][kotlinx-coroutines] artifact. **FlowBinding** offers an extensive set of extension functions that turn traditional callbacks / listeners on Android UI widgets into the `Flow` type. ## Article - [Binding Android UI with Kotlin Flow][article] - featured in [Kotlin Weekly #170][kotlin-weekly] - [FlowBinding 1.0](https://dev.to/ychescale9/flowbinding-1-0-44h) ## Download Dependencies are hosted on [Maven Central][maven-central]. Latest version: ```groovy def flowbinding_version = "1.2.0" ``` ### Platform Bindings ```groovy implementation "io.github.reactivecircus.flowbinding:flowbinding-android:${flowbinding_version}" ``` ### AndroidX Bindings ```groovy implementation "io.github.reactivecircus.flowbinding:flowbinding-activity:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-appcompat:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-core:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-drawerlayout:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-lifecycle:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-navigation:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-preference:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-recyclerview:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-swiperefreshlayout:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-viewpager:${flowbinding_version}" implementation "io.github.reactivecircus.flowbinding:flowbinding-viewpager2:${flowbinding_version}" ``` ### Material Components Bindings ```groovy implementation "io.github.reactivecircus.flowbinding:flowbinding-material:${flowbinding_version}" ``` Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap]. ## Usage ### Binding UI Events To observe click events on an Android `View`: ```kotlin findViewById