1.DownloadClient.ets optimize the code
2.GlideImage display PixelMap No more blank PixelMap needed Signed-off-by: zhoulisheng <635547767@qq.com>
This commit is contained in:
parent
fbca3f8205
commit
28248d3d26
|
@ -199,13 +199,11 @@ export struct GlideImage {
|
|||
|
||||
this.normalPixelMap = true;
|
||||
this.normalResource = true;
|
||||
let pack = new PixelMapPack();
|
||||
this.glidePixelMapPack = pack;
|
||||
setTimeout(() => {
|
||||
|
||||
let pixelMapPack2 = new PixelMapPack();
|
||||
pixelMapPack2.pixelMap = data.glideValue as PixelMap;
|
||||
this.glidePixelMapPack = pixelMapPack2;
|
||||
},100)
|
||||
|
||||
}
|
||||
|
||||
displayResource(data:GlideData){
|
||||
|
|
|
@ -27,7 +27,11 @@ export class DownloadClient implements IDataFetch {
|
|||
if (requestUrl.startsWith("http") || requestUrl.startsWith("https")) {
|
||||
let filename = Md5.hashStr(request.generateDataKey);
|
||||
let downloadFolder = request.getFilesPath() + "/" +request.networkCacheFolder;
|
||||
let allpath = request.getFilesPath() + "/" + filename + ".img";
|
||||
let allpath = request.getFilesPath() + "/" +request.networkCacheFolder + "/" + filename + ".img";
|
||||
|
||||
if(!FileUtils.getInstance().existFolder(downloadFolder)){
|
||||
FileUtils.getInstance().createFolder(downloadFolder)
|
||||
}
|
||||
|
||||
if(FileUtils.getInstance().exist(allpath)){
|
||||
FileUtils.getInstance().deleteFile(allpath)
|
||||
|
|
Loading…
Reference in New Issue