lopspower / CircularProgressBar

Create circular ProgressBar in Android ⭕
Apache License 2.0
1.74k stars 223 forks source link

Build fails while using Databinding #48

Open rajBopche opened 4 years ago

rajBopche commented 4 years ago

For some reason, the build fails while using databindng feature with the progress bar.

I was using the binding variable to set the progress value on the progressbar. The code is as follows

<com.mikhaellopez.circularprogressbar.CircularProgressBar 
            app:cpb_background_progressbar_color="@color/c_light_orange_ff"
            app:cpb_background_progressbar_width="@dimen/spacing_4"
            .
            .
            .
            app:cpb_progress="@{vm.progress}" 
/>

Above vm is the binding variable and progress is a variable of type Float

I use databinding in my project heavily and every other databinding expression is working fine. Only when I try to use the binding with CircularProgressBar the build fails with a very generic error BindingClassImpl symbol not found(Thanks DataBinding it was very helpful -_- ).

Can someone please guide what am I probably doing wrong?

Environment Specs: Dependency:implementation 'com.mikhaellopez:circularprogressbar:3.0.3' Android Studio: 3.5.2 Gradle Distribution: gradle-5.1.1-all.zip Mac Os: Catalina 10.15.5 Model: MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) Processor: 2.3 GHz Dual-Core Intel Core i5

secretshardul commented 4 years ago

+1 @rajBopche you were able to get data binding running?

hossein-no1 commented 4 years ago

this is my problem too. there isn't respond yet?

congpeijun commented 2 years ago

What's the state of this issue? I got the issue too.

congpeijun commented 2 years ago

I create a bindingAdapter, and it works

 @BindingAdapter(value = ["cpb_progress"])
    @JvmStatic
    fun setProgress(circularProgressBar: CircularProgressBar, process: Float?) {
        circularProgressBar.setProgressWithAnimation(process ?: 0f, 1000)
    }