包含内容: - thirdparty flavor 独立 applicationId + Intent 入口(ThirdPartyEntryActivity) - 58 后端接口适配(单 /api 路径、code 0/200、camelCase 字段、UNBOUND 轮询) - MAC 硬件锚定校验(防一凭证多设备共用) - EPG mac 覆盖 SDK init(sMacOverride)+ ChannelManger 初始化对齐 - 提示文案优化(设备未注册/权益未绑定)
25 lines
688 B
Java
Executable File
25 lines
688 B
Java
Executable File
package com.pukka.jiecheng.utils;
|
|
|
|
public class PageNumberUtil {
|
|
/**
|
|
* 计算总页数
|
|
* */
|
|
public static int calculateTotalPages(int totalItems, int pageSize) {
|
|
if (totalItems <= 0) {
|
|
return 0; // 没有数据时返回0页
|
|
}
|
|
if (pageSize <= 0) {
|
|
throw new IllegalArgumentException("每页大小必须大于0");
|
|
}
|
|
return (totalItems - 1) / pageSize + 1;
|
|
}
|
|
/**
|
|
* 计算当前页数
|
|
* @param position 当前position
|
|
* @param itemsPerPage 每页项数
|
|
* */
|
|
public static int calculatePage(int position, int itemsPerPage) {
|
|
return (position / itemsPerPage) + 1;
|
|
}
|
|
}
|