修复图标选择器网格空白:移除 grid.post 依赖,直接使用默认尺寸渲染
问题:弹窗能打开但图标列表不显示,网格内容为空。 原因:grid.post Runnable 在后台线程中可能未执行或执行延迟。 解决:直接传入默认尺寸 (300dp x 360dp) 计算 pageSize, 然后直接调用 renderGrid(),不再等待 grid 布局完成。
This commit is contained in:
@@ -4144,23 +4144,9 @@ FloatBallAppWM.prototype.showShortXIconPickerPopup = function(opts) {
|
||||
afterTextChanged: function() {}
|
||||
}));
|
||||
|
||||
grid.post(new java.lang.Runnable({
|
||||
run: function() {
|
||||
try {
|
||||
var w = grid.getWidth();
|
||||
var h = grid.getHeight();
|
||||
if (w > 0 && h > 0) {
|
||||
resolvePageSize(w, h);
|
||||
renderGrid();
|
||||
} else {
|
||||
grid.postDelayed(new java.lang.Runnable({ run: function() {
|
||||
resolvePageSize(grid.getWidth(), grid.getHeight());
|
||||
renderGrid();
|
||||
}}), 100);
|
||||
}
|
||||
} catch(ePost) { safeLog(self.L, 'e', "iconPicker post err=" + String(ePost)); }
|
||||
}
|
||||
}));
|
||||
// 直接计算默认页面大小并渲染,不依赖 grid.post
|
||||
resolvePageSize(self.dp(300), self.dp(360));
|
||||
renderGrid();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user