fix(th_14_panels): 修复ShortX图标选择器确认后预览框未刷新问题
- 将previewNameTv.setText提前到inputShortXIconTint.getValue()之前 - 为tintHex读取添加独立try-catch,避免异常阻断预览文本更新 - 为updateShortXIconPreview添加错误日志输出
This commit is contained in:
@@ -1077,11 +1077,12 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
|
|||||||
function updateShortXIconPreview() {
|
function updateShortXIconPreview() {
|
||||||
try {
|
try {
|
||||||
var normalizedShort = currentShortXIconName ? self.normalizeShortXIconName(currentShortXIconName, false) : "";
|
var normalizedShort = currentShortXIconName ? self.normalizeShortXIconName(currentShortXIconName, false) : "";
|
||||||
var tintHex = String(inputShortXIconTint.getValue() || "");
|
|
||||||
if (shortxPickerState.previewNameTv) {
|
if (shortxPickerState.previewNameTv) {
|
||||||
shortxPickerState.previewNameTv.setText(normalizedShort ? ("已选: " + normalizedShort) : "未选择图标");
|
shortxPickerState.previewNameTv.setText(normalizedShort ? ("\u5df2\u9009: " + normalizedShort) : "\u672a\u9009\u62e9\u56fe\u6807");
|
||||||
}
|
}
|
||||||
if (shortxPickerState.previewIv) {
|
if (shortxPickerState.previewIv) {
|
||||||
|
var tintHex = "";
|
||||||
|
try { tintHex = String(inputShortXIconTint.getValue() || ""); } catch(eTint) {}
|
||||||
var drPreview = normalizedShort ? self.resolveShortXDrawable(normalizedShort, tintHex) : null;
|
var drPreview = normalizedShort ? self.resolveShortXDrawable(normalizedShort, tintHex) : null;
|
||||||
if (drPreview) {
|
if (drPreview) {
|
||||||
shortxPickerState.previewIv.setImageDrawable(drPreview);
|
shortxPickerState.previewIv.setImageDrawable(drPreview);
|
||||||
@@ -1091,7 +1092,9 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() {
|
|||||||
try { shortxPickerState.previewIv.setAlpha(0.35); } catch(eA2) {}
|
try { shortxPickerState.previewIv.setAlpha(0.35); } catch(eA2) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(ePreview) {}
|
} catch(ePreview) {
|
||||||
|
safeLog(self.L, 'e', "updateShortXIconPreview err=" + String(ePreview));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderShortXIconGrid() {
|
function renderShortXIconGrid() {
|
||||||
|
|||||||
Reference in New Issue
Block a user