Closed jjsil closed 7 years ago
Perfect! This makes complete sense to me. @hapticdata @trippedout Have a look here. I tested the code by merging on my local it seems to work fine.
I know its been a long time, but something similar to this has now been implemented in the app.
Currently the radius of the inner battery circle is calculated by multiplying it by the battery fraction directly. This results in the circle looking smaller than expected because the area is smaller.
For example, when the battery is at 50% the battery fraction is 0.5. The area of the outer circle is Pi_r. The area of the inner circle is Pir(0.5)^2 which is Pi_r*0.25. So the area of the inner circle is 25% of the outer circle instead of 50%.
This changes the calculation so that the inner circle area reflects the battery percentage instead of the radius.
Tested on a Nexus 5X running Marshmellow.
Related issue: #6