Skip to content

Instantly share code, notes, and snippets.

@GrenderG
Created April 22, 2015 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GrenderG/aa84cb0d0149b1615d70 to your computer and use it in GitHub Desktop.
Save GrenderG/aa84cb0d0149b1615d70 to your computer and use it in GitHub Desktop.
View con circulos superpuestos.
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