tempus/app/src/main/java/com/cappielloantonio/play/util/UIUtil.java

14 lines
324 B
Java
Raw Normal View History

2021-07-29 14:19:19 +02:00
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;
2021-08-01 11:48:18 +02:00
} else {
2021-07-29 14:19:19 +02:00
return itemSize % maxSpan;
}
}
}