修改房间布局,根据宽度计算高度

This commit is contained in:
2025-09-06 16:17:36 +08:00
parent e47bcfb8ab
commit 0db678d6a6
5 changed files with 62 additions and 15 deletions

View File

@@ -122,16 +122,23 @@ public class SystemUtils {
return headers;
}
private static String encodeHeadInfo( String headInfo ) {
private static String encodeHeadInfo(String headInfo) {
StringBuffer stringBuffer = new StringBuffer();
for (int i = 0, length = headInfo.length(); i < length; i++) {
char c = headInfo.charAt(i);
if (c <= '\u001f' || c >= '\u007f') {
stringBuffer.append( String.format ("\\u%04x", (int)c) );
stringBuffer.append(String.format("\\u%04x", (int) c));
} else {
stringBuffer.append(c);
}
}
return stringBuffer.toString();
}
public static int getWidth(int value) {
// 获取屏幕宽度
int screenWidth = com.blankj.utilcode.util.ScreenUtils.getScreenWidth();
// 按照公式计算value / 375 * screenWidth
return (int) ((value / 375.0) * screenWidth);
}
}