totalSize -= (ds.startInset + ds.endInset);
    private void distributeSizes(DistributedSize ds, int totalSize, int gap, boolean hasStart, boolean hasCenter, boolean hasEnd) {        if (hasStart && hasCenter)            totalSize -= gap;        if (hasCenter && hasEnd)            totalSize -= gap;        if (hasEnd && hasStart && !hasCenter)            totalSize -= gap;        if (ds.startSize + ds.centerSize + ds.endSize <= totalSize)            ds.centerSize = totalSize - ds.startSize - ds.endSize;        else {            float sum = ds.startSize + ds.endSize;            if (sum < totalSize) {                ds.centerSize = (int) (totalSize - sum);            } else {                ds.startSize = (int) (totalSize * (ds.startSize / sum));                ds.centerSize = (int) (totalSize * (ds.centerSize / sum));                ds.endSize = totalSize - ds.startSize - ds.centerSize;            }        }    }