Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,36 @@ class MainActivity : AppCompatActivity() {
}

}
```

🌟 You are all set!
You can also directly integrate livedata to your button. This will automatically change the state of
button according to the livedata.

```kotlin

//This is an enum that contains all button states, use this for livedata
enum class ButtonStates {
LOADING, ENABLED, DISABLED, FINISHED
}

## 🍰 Contribute
//liveData variable
val buttonState = MutableLiveData<ButtonStates>()

//In Fragment or Activity
binding.progressButton.attachToLiveData(buttonState)

```

Just post the button state to the livedata like
`livedata.postValue(ButtonStates.LOADING)` and button will change to loading state automatically

🌟 You are all set!

Feel free to fork this project, to optimise the code or to add new features.
## 🍰 Contribute

Feel free to fork this project, to optimise the code or to add new features.

## 📝 TODO
## 📝 TODO

* Lottie support

Expand Down