Let our snippet section begin with some fresh Java (Android focused) code here! If you want to get the positions of n-overlapping circles like so:
Check this:
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;
}
An int array containing the starting position where each circle should be placed.