Ramotion / fluid-slider-android

:octocat:💧 A slider widget with a popup bubble displaying the precise value selected. Android library made by @Ramotion
https://www.ramotion.com/agency/app-development/
MIT License
1.42k stars 148 forks source link

Caculations in drawMetaball #16

Closed ltvu93 closed 5 years ago

ltvu93 commented 6 years ago

Hello, I want use code in drawMetaball method for custom my widgets, but the caculations is too hard. Can you provide me some clues or geometric drawing? Thank you.

golovin47 commented 5 years ago

Hello, ltvu93. The code itself is pretty much self documented. The best way to understand it to use in your project is by passing your own parameters to drawMetaball method, i.e. canvas: Canvas, paint: Paint, path: Path, circle1: RectF, circle2: RectF, topBorder: Float, riseDistance: Float, maxDistance: Float, cornerRadius: Float, topSpreadFactor: Float, bottomStartSpreadFactor: Float, bottomEndSpreadFactor: Float, handleRate: Float

You will see how it behaves, so it will be easier to understand the logic of it.