futuredapp / donut

Doughnut-like graph view capable of displaying multiple datasets with assignable colors
MIT License
546 stars 46 forks source link

Support with java. #62

Closed engr-kishon closed 3 years ago

engr-kishon commented 3 years ago

Can I implement this in my JAVA based app?

matejsemancik commented 3 years ago

Should work, as Kotlin is interoperable with Java. Take a look at docs. You will need to set up your Android project with Kotlin, though.

engr-kishon commented 3 years ago

It worked with java too.

matejsemancik commented 3 years ago

Glad you worked it out. Closing the issue.

sysoppl commented 2 years ago

@kish0n-eng Any samples of code how you get it done? I'm trying to implement donut with my java app but without success.

engr-kishon commented 2 years ago

@kish0n-eng Any samples of code how you get it done? I'm trying to implement donut with my java app but without success.

@sysoppl I don't have any sample code. But I ve implemented on my project. I can help you. Please tell me what problem are you facing?

received_3768852099836325.jpeg

sysoppl commented 2 years ago

I defined donut view

DonutProgressView aqiCircle;

...

aqiCircle = findViewById(R.id.aqi_donut);

My XML file contains donut view

        <app.futured.donut.DonutProgressView
            android:id="@+id/aqi_donut"
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_marginTop="25dp"
            app:donut_bgLineColor="@color/red_btn_bg_color"
            app:donut_gapAngle="270"
            app:donut_gapWidth="20"
            app:donut_strokeWidth="16dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

and I'm adding values to it

aqiCircle.setCap(5f);
aqiCircle.addAmount("1", 1f, null);

I tried addAmout, setAmout, setMasterProgress but every time my view is the same (default) image

PS. that's a beautiful app!

engr-kishon commented 2 years ago

@sysoppl Please check out this https://gist.github.com/kish0n-eng/6faa288385d8ec17683e95cd7345283f

sysoppl commented 2 years ago

Oh God, I tried List but I had do something wrong, it was so simple 😅 Thank you so much!

engr-kishon commented 2 years ago

@sysoppl My pleasure. 😊