FlowBinding Material Components

This module provides bindings for the Material Components library.

Transitive Dependency

com.google.android.material:material

Download

1
implementation "io.github.reactivecircus.flowbinding:flowbinding-material:${flowbinding_version}"

Available Bindings

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// AppBarLayout
fun AppBarLayout.offsetChanges(): Flow<Int>

// BottomNavigationView
fun BottomNavigationView.itemReselections(): Flow<MenuItem>
fun BottomNavigationView.itemSelections(emitImmediately: Boolean = false): Flow<MenuItem>

// BottomSheetBehavior
fun View.bottomSheetSlides(): Flow<Float>
fun View.bottomSheetStateChanges(): Flow<Int>

// Chip
fun Chip.closeIconClicks(): Flow<Unit>

// ChipGroup
fun ChipGroup.chipCheckedChanges(emitImmediately: Boolean = false): Flow<Int>

// MaterialButton
fun MaterialButton.checkedChanges(): Flow<Boolean>

// MaterialButtonToggleGroup
fun MaterialButtonToggleGroup.buttonCheckedChanges(): Flow<MaterialButtonCheckedChangedEvent>

// MaterialCardView
fun MaterialCardView.checkedChanges(emitImmediately: Boolean = false): Flow<Boolean>

// MaterialDatePicker
fun <S> MaterialDatePicker<S>.cancels(): Flow<Unit>
fun <S> MaterialDatePicker<S>.dismisses(): Flow<Unit>
fun <S> MaterialDatePicker<S>.negativeButtonClicks(): Flow<Unit>
fun <S> MaterialDatePicker<S>.positiveButtonClicks(): Flow<S>

// NavigationView
fun NavigationView.itemSelections(emitImmediately: Boolean = false): Flow<MenuItem>

// Slider
fun Slider.valueChanges(emitImmediately: Boolean = false): Flow<Float>

// Snackbar
fun Snackbar.dismissEvents(): Flow<Int>
fun Snackbar.shownEvents(): Flow<Unit>

// SwipeDismissBehavior
fun View.dismisses(): Flow<View>
fun View.swipeDismissDragStateChanges(): Flow<Int>

// TabLayout
fun TabLayout.tabSelectionEvents(emitImmediately: Boolean = false): Flow<TabLayoutSelectionEvent>

// TabLayout
fun TabLayout.textInputLayoutStartIconClicks(): Flow<Unit>
fun TabLayout.textInputLayoutEndIconClicks(): Flow<Unit>
fun TabLayout.textInputLayoutStartIconLongClicks(): Flow<Unit>
fun TabLayout.textInputLayoutEndIconLongClicks(): Flow<Unit>