This repository was archived by the owner on Apr 10, 2022. It is now read-only.
Update BatteryDrawer.java#11
Open
androidnaut wants to merge 2 commits intogooglecreativelab:masterfrom
Open
Conversation
The battery life indicator is a circle within a circle. The inner circle currently has its radius set to the battery life percentage of the radius of the overall circle. Thus, when battery life is at 50%, the radius or diameter of the smaller circle is 50% of the radius or diameter of the overall circle. This is not an accurate representation of battery life. Instead, the AREA of the circles should represent the battery percentage left. Remember pi r-squared is the area of a circle, so if square the radius of the large circle, multiply by the battery percentage, and then take the square root of that, we'll have a smaller circle which area is proportional to the larger circle according to the percentage battery life left. This is a much more accurate indication of battery life.
Oops -- forgot to cast my edited 3rd argument to float. Fixed. Works great on N6 running 5.1.1 and more accurately represents remaining battery life.
Author
|
Oops -- I forgot to cast the 3rd argument I changed to drawCircle to float. That has now been done. The app runs great on an N6 with 5.1.1 and now more accurately represents remaining battery life. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The battery life indicator is a circle within a circle.
The inner circle currently has its radius set to the battery life percentage of the radius of the overall circle. Thus, when battery life is at 50%, the radius or diameter of the smaller circle is 50% of the radius or diameter of the overall circle. This is not an accurate representation of battery life. Instead, the AREA of the circles should represent the battery percentage left. Remember pi r-squared is the area of a circle, so if square the radius of the large circle, multiply by the battery percentage, and then take the square root of that, we'll have a smaller circle which area is proportional to the larger circle according to the percentage battery life left. This is a much more accurate indication of battery life.