update common/src/main/ets/default/utils/UiUtil.ts.

Signed-off-by: liujuan <liujuan76@h-partners.com>
This commit is contained in:
liujuan 2023-07-24 09:29:48 +00:00 committed by Gitee
parent 92049f82bd
commit 275c1c0406
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -20,7 +20,7 @@ import { ScreenManager } from '../model/common/ScreenManager';
import prompt from '@system.prompt';
import type window from '@ohos.window';
import type { Action } from '../view/browserOperation/Action';
import { AlbumDefine } from '../model/browser/AlbumDefine';
import { AlbumInfo } from '../model/browser/album/AlbumInfo';
const TAG: string = 'common_UiUtil';
@ -241,4 +241,21 @@ export class UiUtil {
}
return true;
}
static getDisplayNameResourceByAlbumInfo(albumInfo: AlbumInfo): Resource {
let res: Resource = null;
if (albumInfo.isPhotoAlbum) {
return $r('app.string.album_photos');
} else if (albumInfo.isFavorAlbum) {
return $r('app.string.album_favor');
} else if (albumInfo.isVideoAlbum) {
return $r('app.string.album_video');
} else if (albumInfo.isTrashAlbum) {
return $r('app.string.album_recycle');
} else if (albumInfo.isScreenShotAlbum) {
return $r('app.string.album_screen_shot');
} else {
return res;
}
}
}