mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
15 lines
332 B
Java
15 lines
332 B
Java
|
|
package com.cappielloantonio.play.util;
|
||
|
|
|
||
|
|
public class UIUtil {
|
||
|
|
public static int getSpanCount(int itemCount, int maxSpan) {
|
||
|
|
int itemSize = itemCount == 0 ? 1 : itemCount;
|
||
|
|
|
||
|
|
if (itemSize / maxSpan > 0) {
|
||
|
|
return maxSpan;
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
return itemSize % maxSpan;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|