Created
April 22, 2015 08:38
-
-
Save GrenderG/aa84cb0d0149b1615d70 to your computer and use it in GitHub Desktop.
View con circulos superpuestos.
This file contains 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
public int[] getCirclePositions(int radius, int viewWidth, int items){ | |
int[] positions = new int[items]; | |
int portionSize = viewWidth / (items + 1); | |
for (int i = 0; i < positions.length; i++){ | |
positions[i] = (portionSize*(i+1)) - radius; | |
} | |
return positions; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment