fix(icon): 添\u52a0 getShortXIconDrawable 方法和占位符,\u4fee\u590d\u56fe\u6807\u4e0d\u663e\u793a
- 补\u5145\u7f3a\u5931的 getShortXIconDrawable() 方法 - 图\u6807\u83b7\u53d6\u5931\u8d25\u65f6\u663e\u793a\u6d45\u8272\u5360\u4f4d\u7b26
This commit is contained in:
@@ -436,6 +436,15 @@ FloatBallAppWM.prototype.resolveShortXDrawable = function(name, tintHex) {
|
||||
return null;
|
||||
};
|
||||
|
||||
FloatBallAppWM.prototype.getShortXIconDrawable = function(name) {
|
||||
try {
|
||||
return this.resolveShortXDrawable(name, null);
|
||||
} catch (e) {
|
||||
safeLog(this.L, 'w', "getShortXIconDrawable failed: " + String(e));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
FloatBallAppWM.prototype.getShortXIconCatalog = function(forceReload) {
|
||||
if (!forceReload && this._shortxIconCatalog) return this._shortxIconCatalog;
|
||||
var out = [];
|
||||
|
||||
@@ -4083,7 +4083,17 @@ FloatBallAppWM.prototype.showShortXIconPickerPopup = function(opts) {
|
||||
iv.setScaleType(android.widget.ImageView.ScaleType.FIT_CENTER);
|
||||
try {
|
||||
var dr = self.getShortXIconDrawable(item.name);
|
||||
if (dr) iv.setImageDrawable(dr);
|
||||
if (dr) {
|
||||
iv.setImageDrawable(dr);
|
||||
} else {
|
||||
// 图\u6807\u83b7\u53d6\u5931\u8d25,\u663e\u793a\u6587\u5b57\u5360\u4f4d\u7b26
|
||||
try {
|
||||
var placeholder = new android.graphics.drawable.GradientDrawable();
|
||||
placeholder.setColor(self.withAlpha(subTextColor, 0.1));
|
||||
placeholder.setCornerRadius(self.dp(6));
|
||||
iv.setBackground(placeholder);
|
||||
} catch(e) {}
|
||||
}
|
||||
} catch(e) {}
|
||||
cell.addView(iv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user