mirror of
https://gitee.com/openharmony/applications_photos
synced 2024-11-23 07:00:09 +00:00
Signed-off-by: liujuan <liujuan76@h-partners.com>
Changes to be committed:
This commit is contained in:
parent
6ab65ba4f8
commit
b6b03909c9
@ -27,7 +27,7 @@ export class MenuOperationFactory {
|
||||
|
||||
public static getInstance(): MenuOperationFactory {
|
||||
if (AppStorage.Get(Constants.APP_KEY_MENU_OPERATION_FACTORY) == null) {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_MENU_OPERATION_FACTORY, new MenuOperationFactory());
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_MENU_OPERATION_FACTORY, new MenuOperationFactory());
|
||||
}
|
||||
return AppStorage.Get(Constants.APP_KEY_MENU_OPERATION_FACTORY);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ export class SelectManager {
|
||||
} else {
|
||||
this.isAllSelected = true;
|
||||
}
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
if (shouldCallSelectALl) {
|
||||
this.mCallbacks.has('allSelect') && this.mCallbacks.get('allSelect')(true);
|
||||
}
|
||||
@ -231,7 +231,7 @@ export class SelectManager {
|
||||
this.inverseSelection = false;
|
||||
this.isAllSelected = false;
|
||||
this.clickedSet.clear();
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
this.mCallbacks.has('allSelect') && this.mCallbacks.get('allSelect')(false);
|
||||
this.mCallbacks.has('updateCount') && this.mCallbacks.get('updateCount')(this.getSelectedCount());
|
||||
}
|
||||
@ -253,7 +253,7 @@ export class SelectManager {
|
||||
this.inverseSelection = false;
|
||||
this.isAllSelected = false;
|
||||
this.clickedSet.clear();
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
this.mCallbacks.has('allSelect') && this.mCallbacks.get('allSelect')(false);
|
||||
this.mCallbacks.has('updateCount') && this.mCallbacks.get('updateCount')(this.getSelectedCount());
|
||||
}
|
||||
@ -593,7 +593,7 @@ export class TimelineSelectManager extends SelectManager {
|
||||
} else {
|
||||
this.isAllSelected = true;
|
||||
}
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
this.mCallbacks.has('updateGroupCount') && this.mCallbacks.get('updateGroupCount')();
|
||||
this.mCallbacks.has('allSelect') && this.mCallbacks.get('allSelect')(true);
|
||||
this.mCallbacks.has('updateCount') && this.mCallbacks.get('updateCount')(this.getSelectedCount());
|
||||
@ -603,7 +603,7 @@ export class TimelineSelectManager extends SelectManager {
|
||||
this.inverseSelection = false;
|
||||
this.isAllSelected = false;
|
||||
this.clearEntryArray();
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
this.mCallbacks.has('updateGroupCount') && this.mCallbacks.get('updateGroupCount')();
|
||||
this.mCallbacks.has('allSelect') && this.mCallbacks.get('allSelect')(false);
|
||||
this.mCallbacks.has('updateCount') && this.mCallbacks.get('updateCount')(this.getSelectedCount());
|
||||
@ -696,7 +696,7 @@ export class TimelineSelectManager extends SelectManager {
|
||||
this.inverseSelection = false;
|
||||
this.isAllSelected = false;
|
||||
this.clearEntryArray();
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
this.mCallbacks.has('updateGroupCount') && this.mCallbacks.get('updateGroupCount')();
|
||||
this.mCallbacks.has('allSelect') && this.mCallbacks.get('allSelect')(false);
|
||||
this.mCallbacks.has('updateCount') && this.mCallbacks.get('updateCount')(this.getSelectedCount());
|
||||
|
@ -26,7 +26,7 @@ export class MediaObserver {
|
||||
|
||||
static getInstance(): MediaObserver {
|
||||
if (AppStorage.get(Constants.APP_KEY_MENU_USER_FILE_MANAGER_OBSERVER) == null) {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_MENU_USER_FILE_MANAGER_OBSERVER, new MediaObserver());
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_MENU_USER_FILE_MANAGER_OBSERVER, new MediaObserver());
|
||||
}
|
||||
return AppStorage.get(Constants.APP_KEY_MENU_USER_FILE_MANAGER_OBSERVER);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export class BroadCastManager {
|
||||
|
||||
public static getInstance(): BroadCastManager {
|
||||
if (AppStorage.get(Constants.APP_KEY_EVENT_BUS) == null) {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_EVENT_BUS, new BroadCastManager());
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_EVENT_BUS, new BroadCastManager());
|
||||
}
|
||||
return AppStorage.get(Constants.APP_KEY_EVENT_BUS);
|
||||
}
|
||||
|
@ -164,11 +164,11 @@ export class HistogramManager {
|
||||
TraceControllerUtils.finishTrace('dataPrepare');
|
||||
Log.info(TAG, `histogram workers data process finished`);
|
||||
// 重置status,防止被上次任务回调干扰
|
||||
AppStorage.SetOrCreate<number>(Constants.HISTOGRAM_READY_STATUS_KEY, HistogramStatus.PREPARING);
|
||||
AppStorage.setOrCreate<number>(Constants.HISTOGRAM_READY_STATUS_KEY, HistogramStatus.PREPARING);
|
||||
// arrayBuffer直接传入,会丢失类型,需要转为string
|
||||
Log.info(TAG, 'serialize the pixel array for histogram draw, pixel array length: ' + resultArray.length);
|
||||
AppStorage.SetOrCreate<string>(Constants.HISTOGRAM_ARRAY_BUFFER_KEY, StringUtil.arraybufferSerialize(resultArray.buffer));
|
||||
AppStorage.SetOrCreate<number>(Constants.HISTOGRAM_READY_STATUS_KEY, HistogramStatus.READY);
|
||||
AppStorage.setOrCreate<string>(Constants.HISTOGRAM_ARRAY_BUFFER_KEY, StringUtil.arraybufferSerialize(resultArray.buffer));
|
||||
AppStorage.setOrCreate<number>(Constants.HISTOGRAM_READY_STATUS_KEY, HistogramStatus.READY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ export class PixelMapManager {
|
||||
|
||||
public static getInstance(): PixelMapManager {
|
||||
if (AppStorage.get(Constants.PIXEL_MAP_MANAGER) == null) {
|
||||
AppStorage.SetOrCreate(Constants.PIXEL_MAP_MANAGER, new PixelMapManager());
|
||||
AppStorage.setOrCreate(Constants.PIXEL_MAP_MANAGER, new PixelMapManager());
|
||||
}
|
||||
return AppStorage.get(Constants.PIXEL_MAP_MANAGER);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ export class ScreenManager {
|
||||
|
||||
static getInstance(): ScreenManager {
|
||||
if (AppStorage.get(Constants.APP_KEY_SCREEN_MANAGER) == null) {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_SCREEN_MANAGER, new ScreenManager());
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_SCREEN_MANAGER, new ScreenManager());
|
||||
}
|
||||
let manager: ScreenManager = AppStorage.get(Constants.APP_KEY_SCREEN_MANAGER);
|
||||
return manager;
|
||||
@ -98,7 +98,7 @@ export class ScreenManager {
|
||||
// Area data obtained through the system interface,
|
||||
// There is a possibility that the area data is incorrect.
|
||||
const statusBarHeight: number = size ? size.top : this.statusBarHeight;
|
||||
AppStorage.SetOrCreate<number>('statusBarHeight', statusBarHeight);
|
||||
AppStorage.setOrCreate<number>('statusBarHeight', statusBarHeight);
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (!size) {
|
||||
reject();
|
||||
@ -376,14 +376,14 @@ export class ScreenManager {
|
||||
|
||||
isHorizontal(): boolean {
|
||||
if (AppStorage.get(Constants.SCREEN_ORIENTATION_HORIZONTAL) == null) {
|
||||
AppStorage.SetOrCreate(Constants.SCREEN_ORIENTATION_HORIZONTAL, this.horizontal);
|
||||
AppStorage.setOrCreate(Constants.SCREEN_ORIENTATION_HORIZONTAL, this.horizontal);
|
||||
}
|
||||
return AppStorage.get(Constants.SCREEN_ORIENTATION_HORIZONTAL);
|
||||
}
|
||||
|
||||
isSidebar(): boolean {
|
||||
if (AppStorage.get(Constants.SCREEN_SIDEBAR) == null) {
|
||||
AppStorage.SetOrCreate(Constants.SCREEN_SIDEBAR, this.sidebar);
|
||||
AppStorage.setOrCreate(Constants.SCREEN_SIDEBAR, this.sidebar);
|
||||
}
|
||||
return AppStorage.get(Constants.SCREEN_SIDEBAR);
|
||||
}
|
||||
@ -405,7 +405,7 @@ export class ScreenManager {
|
||||
return;
|
||||
}
|
||||
this.horizontal = isH;
|
||||
AppStorage.SetOrCreate(Constants.SCREEN_ORIENTATION_HORIZONTAL, this.horizontal);
|
||||
AppStorage.setOrCreate(Constants.SCREEN_ORIENTATION_HORIZONTAL, this.horizontal);
|
||||
}
|
||||
|
||||
private getMainWindow(): window.Window {
|
||||
@ -434,7 +434,7 @@ export class ScreenManager {
|
||||
};
|
||||
// Area data obtained through the system interface,
|
||||
// There is a possibility that the area data is incorrect.
|
||||
AppStorage.SetOrCreate<number>('statusBarHeight', area.topRect.height);
|
||||
AppStorage.setOrCreate<number>('statusBarHeight', area.topRect.height);
|
||||
this.statusBarHeight = px2vp(area.topRect.height);
|
||||
this.naviBarHeight = px2vp(area.bottomRect.height);
|
||||
this.leftBlank = [this.leftBlank[0], this.leftBlank[1], this.leftBlank[2], px2vp(area.bottomRect.height)];
|
||||
|
@ -43,7 +43,7 @@ export class StatusBarColorController {
|
||||
|
||||
public static getInstance(): StatusBarColorController {
|
||||
if (AppStorage.get(Constants.APP_KEY_STATUS_BAR_COLOR_CONTROLLER) == null) {
|
||||
AppStorage.SetOrCreate(
|
||||
AppStorage.setOrCreate(
|
||||
Constants.APP_KEY_STATUS_BAR_COLOR_CONTROLLER, new StatusBarColorController());
|
||||
}
|
||||
return AppStorage.get(Constants.APP_KEY_STATUS_BAR_COLOR_CONTROLLER);
|
||||
|
@ -115,7 +115,7 @@ export class BreakpointSystem {
|
||||
private updateCurrentBreakpoint(breakpoint: string): void {
|
||||
if (this.currentBreakpoint !== breakpoint) {
|
||||
this.currentBreakpoint = breakpoint;
|
||||
AppStorage.SetOrCreate<string>(this.breakpointStorageKey, this.currentBreakpoint);
|
||||
AppStorage.setOrCreate<string>(this.breakpointStorageKey, this.currentBreakpoint);
|
||||
Log.debug(TAG, 'on current breakpoint: ' + this.currentBreakpoint);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export class DataStoreUtil {
|
||||
|
||||
public static getInstance(): DataStoreUtil {
|
||||
if (AppStorage.get(Constants.FROM_DATA_STORE_UTIL) == null) {
|
||||
AppStorage.SetOrCreate(Constants.FROM_DATA_STORE_UTIL, new DataStoreUtil());
|
||||
AppStorage.setOrCreate(Constants.FROM_DATA_STORE_UTIL, new DataStoreUtil());
|
||||
}
|
||||
return AppStorage.get(Constants.FROM_DATA_STORE_UTIL);
|
||||
}
|
||||
|
@ -292,15 +292,15 @@ export class UiUtil {
|
||||
}
|
||||
|
||||
static resetGeometryTransitionParams(): void {
|
||||
AppStorage.SetOrCreate<number>('geometryScale', 1);
|
||||
AppStorage.SetOrCreate<number>('geometryOffsetX', 0);
|
||||
AppStorage.SetOrCreate<number>('geometryOffsetY', 0);
|
||||
AppStorage.SetOrCreate<number>('geometryOpacity', 1);
|
||||
AppStorage.setOrCreate<number>('geometryScale', 1);
|
||||
AppStorage.setOrCreate<number>('geometryOffsetX', 0);
|
||||
AppStorage.setOrCreate<number>('geometryOffsetY', 0);
|
||||
AppStorage.setOrCreate<number>('geometryOpacity', 1);
|
||||
}
|
||||
|
||||
static updateGeometryTapInfo(geometryTapIndex: number, geometryTransitionString: string): void {
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', geometryTapIndex);
|
||||
AppStorage.SetOrCreate<string>('geometryTransitionBrowserId',
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', geometryTapIndex);
|
||||
AppStorage.setOrCreate<string>('geometryTransitionBrowserId',
|
||||
geometryTransitionString);
|
||||
Log.debug(TAG, 'this.geometryTransitionId = ' + geometryTransitionString +
|
||||
', placeholderIndex = ' + geometryTapIndex);
|
||||
|
@ -67,7 +67,7 @@ export class BrowserController {
|
||||
animateTo({
|
||||
curve: Constants.SPRING_MOTION_CURVE, // 大图进出阻尼曲线参数
|
||||
onFinish: () => {
|
||||
AppStorage.SetOrCreate<string>('geometryTransitionBrowserId', '');
|
||||
AppStorage.setOrCreate<string>('geometryTransitionBrowserId', '');
|
||||
UiUtil.resetGeometryTransitionParams();
|
||||
this.finishAnimation();
|
||||
}
|
||||
@ -75,7 +75,7 @@ export class BrowserController {
|
||||
this.isBrowserShow = false;
|
||||
this.browserParam;
|
||||
this.isAnimating = true;
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', -1);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', -1);
|
||||
Log.info(TAG, `placeholderIndex ${AppStorage.get<number>('placeholderIndex')}`);
|
||||
});
|
||||
}
|
||||
@ -103,7 +103,7 @@ export class BrowserController {
|
||||
animateTo({
|
||||
curve: Constants.SPRING_MOTION_CURVE, // 大图进出阻尼曲线参数
|
||||
onFinish: () => {
|
||||
AppStorage.SetOrCreate<string>('geometryTransitionBrowserId', '');
|
||||
AppStorage.setOrCreate<string>('geometryTransitionBrowserId', '');
|
||||
UiUtil.resetGeometryTransitionParams();
|
||||
this.finishAnimation();
|
||||
}
|
||||
@ -111,7 +111,7 @@ export class BrowserController {
|
||||
this.isSelectBrowserShow = false;
|
||||
this.selectBrowserParam;
|
||||
this.isAnimating = true;
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', -1);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', -1);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ export struct Histogram {
|
||||
|
||||
aboutToDisappear() {
|
||||
Log.info(TAG, 'histogram aboutToDisappear, ready status reset');
|
||||
AppStorage.SetOrCreate<number>(Constants.HISTOGRAM_READY_STATUS_KEY, HistogramStatus.PREPARING);
|
||||
AppStorage.setOrCreate<number>(Constants.HISTOGRAM_READY_STATUS_KEY, HistogramStatus.PREPARING);
|
||||
HistogramManager.getInstance().clear();
|
||||
WorkerThreadPool.getInstance().stop();
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ export struct ImageGridItemComponent {
|
||||
selectStateChange() {
|
||||
Log.info(TAG, 'change selected.');
|
||||
let newState = !this.isSelected;
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
if (this.item != null && this.item.uri) {
|
||||
this.mPosition = this.getPosition();
|
||||
this.broadCast.emit(BroadCastConstants.SELECT, [this.mPosition, this.item.uri, newState, (isSelected: boolean): void => {
|
||||
@ -254,7 +254,7 @@ export struct ImageGridItemComponent {
|
||||
.focusSetting(this.item == null ? '' : this.item.uri, (event: KeyEvent): void => this.handleKeyEvent(event))
|
||||
.onError(() => {
|
||||
this.isLoadImageError = true;
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
Log.error(TAG, 'item Image error');
|
||||
})
|
||||
.onComplete(() => {
|
||||
@ -524,7 +524,7 @@ export struct ImageGridItemComponent {
|
||||
if (ret !== true) {
|
||||
Log.error(TAG, `requestFocus${keyName + this.item.uri}, ret:${ret}`);
|
||||
}
|
||||
AppStorage.SetOrCreate('focusUpdate', false);
|
||||
AppStorage.setOrCreate('focusUpdate', false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ export struct PhotoItem {
|
||||
|
||||
private saveScale(): void {
|
||||
if (this.currentIndex == this.mPosition) {
|
||||
AppStorage.SetOrCreate(PhotoConstants.MATRIX, this.matrix);
|
||||
AppStorage.setOrCreate(PhotoConstants.MATRIX, this.matrix);
|
||||
}
|
||||
}
|
||||
|
||||
@ -613,7 +613,7 @@ export struct PhotoItem {
|
||||
// Calculate image opacity by distance Y, min opacity is 0
|
||||
let calcTouchOpacity = Constants.NUMBER_1 - distanceY * PhotoConstants.DRAG_OPACITY;
|
||||
let touchOpacity = calcTouchOpacity > Constants.NUMBER_0 ? calcTouchOpacity : Constants.NUMBER_0;
|
||||
AppStorage.SetOrCreate<number>('geometryOpacity', touchOpacity);
|
||||
AppStorage.setOrCreate<number>('geometryOpacity', touchOpacity);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,9 @@ export class BatchDeleteMenuOperation extends ProcessMenuOperation {
|
||||
|
||||
setConfirmText(): void {
|
||||
if (!this.isTrash) {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete_permanently'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete_permanently'));
|
||||
} else {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ export class BatchRemoveMenuOperation extends ProcessMenuOperation {
|
||||
}
|
||||
|
||||
setConfirmText(): void {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_remove'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_remove'));
|
||||
}
|
||||
|
||||
doAction(): void {
|
||||
|
@ -62,9 +62,9 @@ export class DeleteMenuOperation implements MenuOperation, MenuOperationCallback
|
||||
|
||||
setConfirmText(): void {
|
||||
if (!this.isTrash) {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete_permanently'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete_permanently'));
|
||||
} else {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ export class MoveOrCopyBroadCastProp {
|
||||
*/
|
||||
public static getInstance(): MoveOrCopyBroadCastProp {
|
||||
if (AppStorage.get<MoveOrCopyBroadCastProp>(Constants.INSTANCE_MOVE_OR_COPY_BROADCAST_PROP) == null) {
|
||||
AppStorage.SetOrCreate(Constants.INSTANCE_MOVE_OR_COPY_BROADCAST_PROP, new MoveOrCopyBroadCastProp());
|
||||
AppStorage.setOrCreate(Constants.INSTANCE_MOVE_OR_COPY_BROADCAST_PROP, new MoveOrCopyBroadCastProp());
|
||||
}
|
||||
return AppStorage.get<MoveOrCopyBroadCastProp>(Constants.INSTANCE_MOVE_OR_COPY_BROADCAST_PROP) as MoveOrCopyBroadCastProp;
|
||||
}
|
||||
@ -147,7 +147,7 @@ export class MoveOrCopyBroadCastProp {
|
||||
}
|
||||
|
||||
private async onOperationEndBindImpl(): Promise<void> {
|
||||
AppStorage.SetOrCreate(Constants.IS_DATA_FREEZE, false);
|
||||
AppStorage.setOrCreate(Constants.IS_DATA_FREEZE, false);
|
||||
let isNewAlbum: boolean = AppStorage.get<boolean>(Constants.APP_KEY_NEW_ALBUM) as boolean;
|
||||
let selectManager: SelectManager = AppStorage.get<SelectManager>(Constants.APP_KEY_NEW_ALBUM_SELECTED) as SelectManager;
|
||||
let targetAlbumName: string = AppStorage.get<string>(Constants.APP_KEY_NEW_ALBUM_TARGET) as string;
|
||||
@ -177,7 +177,7 @@ export class MoveOrCopyBroadCastProp {
|
||||
AppStorage.setOrCreate<ParamAlbumInfo>(Constants.KEY_OF_PHOTO_GRID_VIEW_ALBUM_ITEM, {
|
||||
item: JSON.stringify(albumInfo)
|
||||
});
|
||||
AppStorage.SetOrCreate(Constants.KEY_OF_ALBUM_URI, albumInfo.uri);
|
||||
AppStorage.setOrCreate(Constants.KEY_OF_ALBUM_URI, albumInfo.uri);
|
||||
router.back({
|
||||
url: 'pages/index',
|
||||
});
|
||||
@ -185,7 +185,7 @@ export class MoveOrCopyBroadCastProp {
|
||||
}
|
||||
|
||||
private onOperationStartBindImpl(): void {
|
||||
AppStorage.SetOrCreate(Constants.IS_DATA_FREEZE, true);
|
||||
AppStorage.setOrCreate(Constants.IS_DATA_FREEZE, true);
|
||||
}
|
||||
|
||||
private async onOperationEnd(): Promise<void> {
|
||||
|
@ -54,7 +54,7 @@ export class RemoveMenuOperation implements MenuOperation, MenuOperationCallback
|
||||
}
|
||||
|
||||
setConfirmText(): void {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_remove'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_remove'));
|
||||
}
|
||||
|
||||
onCompleted(): void {
|
||||
|
@ -125,7 +125,7 @@ export class ShareMenuOperation implements MenuOperation, AsyncCallback<MediaIte
|
||||
let oldCount: number = AppStorage.get('click_share_count');
|
||||
count = oldCount + 1;
|
||||
}
|
||||
AppStorage.SetOrCreate('click_share_count', count);
|
||||
AppStorage.setOrCreate('click_share_count', count);
|
||||
let msg = {
|
||||
'count': count,
|
||||
'shareType': shareType,
|
||||
|
@ -35,9 +35,9 @@ export class ThirdDeleteOperation extends ProcessMenuOperation {
|
||||
|
||||
setConfirmText(): void {
|
||||
if (!this.isTrash) {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete_permanently'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete_permanently'));
|
||||
} else {
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_delete'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export struct DeleteDialog {
|
||||
|
||||
aboutToDisappear() {
|
||||
if (this.isFirstTimeDelete) {
|
||||
AppStorage.SetOrCreate(Constants.IS_FIRST_TIME_DELETE, false);
|
||||
AppStorage.setOrCreate(Constants.IS_FIRST_TIME_DELETE, false);
|
||||
let pref: data_preferences.Preferences = AppStorage.get<data_preferences.Preferences>(Constants.PHOTOS_STORE_KEY) as data_preferences.Preferences;
|
||||
pref.put(Constants.IS_FIRST_TIME_DELETE, false).then(() => {
|
||||
Log.debug(TAG, `Succeeded in putting the value of '${Constants.IS_FIRST_TIME_DELETE}'.`);
|
||||
|
@ -98,18 +98,18 @@ export struct AlbumGridItemNewStyle {
|
||||
duration: albumToPhotoGridDuration,
|
||||
curve: Curve.Friction,
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<boolean>(Constants.KEY_OF_IS_SHOW_PHOTO_GRID_VIEW,!this.isShowPhotoGridView);
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_SELECTED_ALBUM_INDEX, this.keyIndex ? this.keyIndex : -1);
|
||||
AppStorage.SetOrCreate<string>(Constants.KEY_OF_SELECTED_ALBUM_URI, this.item.uri);
|
||||
AppStorage.setOrCreate<boolean>(Constants.KEY_OF_IS_SHOW_PHOTO_GRID_VIEW,!this.isShowPhotoGridView);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_SELECTED_ALBUM_INDEX, this.keyIndex ? this.keyIndex : -1);
|
||||
AppStorage.setOrCreate<string>(Constants.KEY_OF_SELECTED_ALBUM_URI, this.item.uri);
|
||||
})
|
||||
animateTo({
|
||||
duration: albumActionBarDuration,
|
||||
curve: Curve.Sharp
|
||||
}, () => {
|
||||
if (AppStorage.get<string>('deviceType') !== Constants.PC_DEVICE_TYPE) {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_ALBUM_OPACITY, 0);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_ALBUM_OPACITY, 0);
|
||||
}
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_ALBUM_ACTIONBAR_OPACITY, 0);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_ALBUM_ACTIONBAR_OPACITY, 0);
|
||||
})
|
||||
animateTo({
|
||||
duration: albumActionBarDuration,
|
||||
@ -117,21 +117,21 @@ export struct AlbumGridItemNewStyle {
|
||||
delay: BrowserConstants.LINK_IN_PHOTO_GRID_DELAY,
|
||||
}, () => {
|
||||
if (AppStorage.get<string>('deviceType') !== Constants.PC_DEVICE_TYPE) {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_VIEW_OPACITY, 1);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_VIEW_OPACITY, 1);
|
||||
}
|
||||
})
|
||||
animateTo({
|
||||
duration: albumToPhotoGridScaleDuration,
|
||||
curve: Curve.Friction
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_ALBUM_OTHER_SCALE, BrowserConstants.Album_Scale);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_ALBUM_OTHER_SCALE, BrowserConstants.Album_Scale);
|
||||
})
|
||||
animateTo({
|
||||
duration: photoGridActionBarDuration,
|
||||
delay: photoGridActionBarDelay,
|
||||
curve: Curve.Sharp
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_ACTIONBAR_OPACITY, 1);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_ACTIONBAR_OPACITY, 1);
|
||||
})
|
||||
|
||||
if (AppStorage.get<string>('deviceType') !== Constants.PC_DEVICE_TYPE) {
|
||||
@ -140,20 +140,20 @@ export struct AlbumGridItemNewStyle {
|
||||
delay: BrowserConstants.LINK_IN_PHOTO_GRID_DELAY,
|
||||
curve: Curve.Sharp
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_VIEW_OPACITY, 1);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_VIEW_OPACITY, 1);
|
||||
})
|
||||
animateTo({
|
||||
duration: BrowserConstants.PC_LINK_ALBUM_DURATION,
|
||||
curve: Curve.Sharp
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_ALBUM_OPACITY, 0);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_ALBUM_OPACITY, 0);
|
||||
})
|
||||
animateTo({
|
||||
duration: BrowserConstants.PC_LINK_IN_SIDEBAR_DURATION,
|
||||
curve: Curve.Sharp
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_SIDE_BAR_OPACITY, 0);
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_SIDE_BAR_BOUNDARY_LINE_OPACITY, 0);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_SIDE_BAR_OPACITY, 0);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_SIDE_BAR_BOUNDARY_LINE_OPACITY, 0);
|
||||
})
|
||||
}
|
||||
|
||||
@ -220,8 +220,8 @@ export struct AlbumGridItemNewStyle {
|
||||
|
||||
Log.info(TAG, 'updateCardSize gridWidth : ' + this.gridWidth + ', gridHeight : ' + this.gridHeight);
|
||||
|
||||
AppStorage.SetOrCreate(Constants.KEY_OF_ALBUM_HEIGHT, this.gridHeight);
|
||||
AppStorage.SetOrCreate(Constants.KEY_OF_ALBUM_WIDTH, this.gridWidth);
|
||||
AppStorage.setOrCreate(Constants.KEY_OF_ALBUM_HEIGHT, this.gridHeight);
|
||||
AppStorage.setOrCreate(Constants.KEY_OF_ALBUM_WIDTH, this.gridWidth);
|
||||
});
|
||||
|
||||
}
|
||||
@ -503,8 +503,8 @@ export struct AlbumGridItemNewStyle {
|
||||
} else if (!this.isShowPhotoGridView) {
|
||||
let albumInfo: ParamAlbumInfo = { item: JSON.stringify(this.item) }
|
||||
AppStorage.setOrCreate<ParamAlbumInfo>(Constants.KEY_OF_PHOTO_GRID_VIEW_ALBUM_ITEM, albumInfo);
|
||||
AppStorage.SetOrCreate(Constants.KEY_OF_GEOMETRY_TRANSITION_ID_HEIGHT, this.transitionId);
|
||||
AppStorage.SetOrCreate(Constants.KEY_OF_ALBUM_URI, this.item.uri);
|
||||
AppStorage.setOrCreate(Constants.KEY_OF_GEOMETRY_TRANSITION_ID_HEIGHT, this.transitionId);
|
||||
AppStorage.setOrCreate(Constants.KEY_OF_ALBUM_URI, this.item.uri);
|
||||
this.doAnimation();
|
||||
} else {
|
||||
Log.info(TAG, `PhotoGridView is show, has no focus, Users need to manually activate the focus.`);
|
||||
|
@ -167,7 +167,7 @@ export struct AlbumSetPage {
|
||||
this.appBroadCast.on(BroadCastConstants.ON_TAB_CHANGED, this.onTabChangedFunc);
|
||||
this.appBroadCast.on(BroadCastConstants.RESET_STATE_EVENT, this.onStateResetFunc);
|
||||
this.appBroadCast.on(BroadCastConstants.SEND_COPY_OR_MOVE_BROADCAST, this.onSendMoveCopyBroadCastFunc);
|
||||
AppStorage.SetOrCreate('setSelectManagerToAnother', this.mSelectManager);
|
||||
AppStorage.setOrCreate('setSelectManagerToAnother', this.mSelectManager);
|
||||
this.broadCast.on(Constants.ON_LOADING_FINISHED, this.onLoadingFinishedFunc);
|
||||
this.appBroadCast.on(BroadCastConstants.RESET_ZERO, this.onResetZeroFunc);
|
||||
this.appBroadCast.on(BroadCastConstants.ON_REMOTE_CHANGED, this.onUpdateRemoteDeviceFunc);
|
||||
|
@ -46,7 +46,7 @@ export class ClearRecycleMenuOperation extends BatchDeleteMenuOperation {
|
||||
return;
|
||||
}
|
||||
|
||||
AppStorage.SetOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_clear'));
|
||||
AppStorage.setOrCreate<Resource>(Constants.CONFIRM_TEXT_KEY, $r('app.string.dialog_clear'));
|
||||
this.menuContext.broadCast.emit(BroadCastConstants.SHOW_DELETE_DIALOG,
|
||||
[$r('app.string.recycleAlbum_clear_message'), (): void => this.confirmCallback(), (): void => this.cancelCallback()]);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ export class PhotoEditorManager {
|
||||
|
||||
static getInstance(): PhotoEditorManager {
|
||||
if (AppStorage.get(Constants.PHOTO_EDITOR_MANAGER) == null) {
|
||||
AppStorage.SetOrCreate(Constants.PHOTO_EDITOR_MANAGER, new PhotoEditorManager());
|
||||
AppStorage.setOrCreate(Constants.PHOTO_EDITOR_MANAGER, new PhotoEditorManager());
|
||||
}
|
||||
return AppStorage.get(Constants.PHOTO_EDITOR_MANAGER);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ export struct CropRulerBar {
|
||||
private previous: number = Constants.NUMBER_0;
|
||||
|
||||
setRulerProperties(rulerWidth: number, rulerHeight: number): void {
|
||||
AppStorage.SetOrCreate<RulerProperties>('rulerProperties', {
|
||||
AppStorage.setOrCreate<RulerProperties>('rulerProperties', {
|
||||
rulerWidth: rulerWidth,
|
||||
rulerHeight: rulerHeight
|
||||
} as RulerProperties)
|
||||
|
@ -84,7 +84,7 @@ export struct TitleBar {
|
||||
UiUtil.showToast($r('app.string.edit_photo_save_fail'));
|
||||
router.back();
|
||||
} else {
|
||||
AppStorage.SetOrCreate(BroadCastConstants.PHOTO_EDIT_SAVE_URI, uri);
|
||||
AppStorage.setOrCreate(BroadCastConstants.PHOTO_EDIT_SAVE_URI, uri);
|
||||
this.appBroadCast.emit(BroadCastConstants.PHOTO_BROWSER_ACTIVE, [true, Constants.PHOTO_TRANSITION_EDIT]);
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ export struct TitleBar {
|
||||
Log.debug(TAG, `backAfterSaveComplete called`);
|
||||
this.appBroadCast.emit(BroadCastConstants.PHOTO_BROWSER_ACTIVE, [false, Constants.PHOTO_TRANSITION_EDIT]);
|
||||
this.broadCast.emit(BroadCastConstants.EXIT_SAVE_PROGRESS_CLOSE, []);
|
||||
AppStorage.SetOrCreate(BroadCastConstants.PHOTO_EDIT_SAVE_URI, "");
|
||||
AppStorage.setOrCreate(BroadCastConstants.PHOTO_EDIT_SAVE_URI, "");
|
||||
router.back();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ export class FormControllerManager {
|
||||
|
||||
public static getInstance(): FormControllerManager {
|
||||
if (AppStorage.Get(Constants.FROM_CONTROLLER_MANAGER) == null) {
|
||||
AppStorage.SetOrCreate(Constants.FROM_CONTROLLER_MANAGER, new FormControllerManager());
|
||||
AppStorage.setOrCreate(Constants.FROM_CONTROLLER_MANAGER, new FormControllerManager());
|
||||
}
|
||||
return AppStorage.Get(Constants.FROM_CONTROLLER_MANAGER);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ export class MediaDataManager {
|
||||
async initShowName(): Promise<number> {
|
||||
let isShowKey = Constants.FROM_PLAYBACK_ISSHOWNAME;
|
||||
let isShow = await dataStore.getData(isShowKey, 1) as number;
|
||||
AppStorage.SetOrCreate(Constants.FROM_PLAYBACK_ISSHOWNAME, isShow);
|
||||
AppStorage.setOrCreate(Constants.FROM_PLAYBACK_ISSHOWNAME, isShow);
|
||||
Log.debug(TAG, `initShowName dataStoreData:${isShow}` +
|
||||
`storageData:${AppStorage.Get(Constants.FROM_PLAYBACK_ISSHOWNAME)}`);
|
||||
return isShow;
|
||||
|
@ -145,7 +145,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
}
|
||||
|
||||
onGeometryChanged() {
|
||||
AppStorage.SetOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
AppStorage.setOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
@ -229,7 +229,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
|
||||
if (newIndex != Constants.NOT_FOUND) {
|
||||
// Search for the position of new image/video after edit in current 500 items succeed
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', newIndex);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', newIndex);
|
||||
if (!this.isMultiPick) {
|
||||
this.currentIndex = newIndex;
|
||||
this.photoUnEdit = this.getCurrentPhoto();
|
||||
@ -332,7 +332,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
if (index != Constants.NOT_FOUND) { // over 500
|
||||
Log.info(TAG, `data reloaded move to ${index}`);
|
||||
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', index);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', index);
|
||||
|
||||
this.dataSource.enableGetData(true);
|
||||
this.dataSource.onDataReloaded();
|
||||
@ -351,7 +351,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
this.updateSelectItemByNewEditIndexFromDataSource(this.currentIndex);
|
||||
|
||||
if (this.dataSource.getSelectMode()) {
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', Constants.INVALID);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', Constants.INVALID);
|
||||
}
|
||||
} else {
|
||||
this.waitingUpdateIndex = index;
|
||||
@ -372,7 +372,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
this.editNewUri = '';
|
||||
this.updateSelectItemByNewEditItem(this.newMediaItem, this.currentIndex);
|
||||
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', Constants.INVALID);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', Constants.INVALID);
|
||||
this.geometryTransitionId = '';
|
||||
});
|
||||
}
|
||||
@ -381,7 +381,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
|
||||
updateSelectItemByNewEditItem(mediaItem: MediaItem, index?: number): void {
|
||||
Log.info(TAG, `updateSelectItemByNewEditItem: index=${index}`);
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', index as number); // timeLineIndex
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', index as number); // timeLineIndex
|
||||
if (!this.isMultiPick) {
|
||||
this.currentIndex = index as number;
|
||||
this.photoUnEdit = this.getCurrentPhoto();
|
||||
@ -411,7 +411,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
|
||||
updateSelectItemByNewEditIndexFromDataSource(index: number): void {
|
||||
Log.info(TAG, `updateSelectItemByNewEditIndexFromDataSource: index=${index}`);
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', index); // timeLineIndex
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', index); // timeLineIndex
|
||||
if (!this.isMultiPick) {
|
||||
this.currentIndex = index;
|
||||
this.photoUnEdit = this.getCurrentPhoto();
|
||||
@ -529,7 +529,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
|
||||
let dataSourceIndex = this.isSelectMode ? (this.selectManager?.getSelectItemDataSourceIndex(currentPhoto) ?? Constants.INVALID) : index;
|
||||
let timelineIndex = this.dataSource.getPositionByIndex(dataSourceIndex);
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', timelineIndex);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', timelineIndex);
|
||||
this.geometryTransitionId = this.browserController.pageFrom + currentPhoto.getHashCode() + this.isSelected;
|
||||
Log.info(TAG, `onPhotoChanged, index: ${index}, currentPhoto: ${currentPhoto.uri}, \
|
||||
geometryTransitionId = ${this.geometryTransitionId}, placeholderIndex = ${timelineIndex}`);
|
||||
|
@ -191,11 +191,11 @@ export struct ThirdSelectPhotoGridBase {
|
||||
|
||||
// 更新编辑许可
|
||||
this.selectParams.editAble = param.editAble;
|
||||
AppStorage.SetOrCreate<boolean>(Constants.KEY_OF_IS_THIRD_EDITABLE, this.selectParams.editAble);
|
||||
AppStorage.setOrCreate<boolean>(Constants.KEY_OF_IS_THIRD_EDITABLE, this.selectParams.editAble);
|
||||
if (this.selectParams.isFromFa) {
|
||||
this.selectParams.filterMediaType = AlbumDefine.FILTER_MEDIA_TYPE_IMAGE;
|
||||
AppStorage.SetOrCreate(FormConstants.FORM_ITEM_ALBUM_URI, param.uri);
|
||||
AppStorage.SetOrCreate(FormConstants.FORM_ITEM_DISPLAY_NAME, param.itemDisplayName);
|
||||
AppStorage.setOrCreate(FormConstants.FORM_ITEM_ALBUM_URI, param.uri);
|
||||
AppStorage.setOrCreate(FormConstants.FORM_ITEM_DISPLAY_NAME, param.itemDisplayName);
|
||||
}
|
||||
this.dataSource.setFilterMediaType(this.selectParams.filterMediaType);
|
||||
this.initSelectManager();
|
||||
@ -245,7 +245,7 @@ export struct ThirdSelectPhotoGridBase {
|
||||
|
||||
// save all photo dataSource
|
||||
if (this.dataSource.albumUri === '' && AppStorage.get<MediaDataSource>(Constants.APP_KEY_ALL_PHOTO_DATASOURCE) === undefined) {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_ALL_PHOTO_DATASOURCE, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_ALL_PHOTO_DATASOURCE, this.dataSource);
|
||||
}
|
||||
ScreenManager.getInstance().on(ScreenManager.ON_WIN_SIZE_CHANGED, this.onWindowSizeChangeCallBack);
|
||||
Log.error(TAG, 'meow data count = ' + this.dataSource.totalCount());
|
||||
@ -598,7 +598,7 @@ export struct ThirdSelectPhotoGridBase {
|
||||
let selectItemIndex: number = this.selectManager?.getSelectItemIndex(item) ?? Constants.INVALID;
|
||||
let targetIndex = isSelectMode ? selectItemIndex : this.dataSource.getDataIndex(item);
|
||||
Log.info(TAG, `jump to photo browser at index: ${targetIndex}, transition: ${name}`);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
if (geometryTapIndex != -1 && geometryTransitionString != '') {
|
||||
this.jumpToBrowserGeometryTransition(
|
||||
targetIndex, name, item, isSelectMode, geometryTapIndex, geometryTransitionString);
|
||||
@ -647,12 +647,12 @@ export struct ThirdSelectPhotoGridBase {
|
||||
} else {
|
||||
Log.debug(TAG, 'create new select manager');
|
||||
this.selectManager = new ThirdSelectManager();
|
||||
AppStorage.SetOrCreate(Constants.THIRD_SELECT_MANAGER, this.selectManager);
|
||||
AppStorage.setOrCreate(Constants.THIRD_SELECT_MANAGER, this.selectManager);
|
||||
}
|
||||
if (this.isFirstEnter) {
|
||||
Log.debug(TAG, 'clear select manager');
|
||||
this.selectManager.deSelectAll();
|
||||
AppStorage.SetOrCreate(THIRD_SELECT_IS_ORIGIN, false);
|
||||
AppStorage.setOrCreate(THIRD_SELECT_IS_ORIGIN, false);
|
||||
}
|
||||
this.selectManager.setGetMediaItemFunc((uri: string): MediaItem => {
|
||||
return this.dataSource.getMediaItemByUri(uri);
|
||||
|
@ -32,7 +32,7 @@ export class TimelineDataSourceManager {
|
||||
|
||||
public static getInstance(): TimelineDataSourceManager {
|
||||
if (AppStorage.Get(TimeLineConstants.APP_KEY_GROUP_DATA_SOURCE_MANAGER) == null) {
|
||||
AppStorage.SetOrCreate(TimeLineConstants.APP_KEY_GROUP_DATA_SOURCE_MANAGER, new TimelineDataSourceManager());
|
||||
AppStorage.setOrCreate(TimeLineConstants.APP_KEY_GROUP_DATA_SOURCE_MANAGER, new TimelineDataSourceManager());
|
||||
}
|
||||
return AppStorage.Get(TimeLineConstants.APP_KEY_GROUP_DATA_SOURCE_MANAGER);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ import { TimelineDataSourceManager } from '../model/TimelineDataSourceManager';
|
||||
import { TimelineScrollBar } from './TimelineScrollBar';
|
||||
|
||||
const TAG: string = 'TimelinePage';
|
||||
AppStorage.SetOrCreate('TimelinePageIndex', Constants.INVALID);
|
||||
AppStorage.setOrCreate('TimelinePageIndex', Constants.INVALID);
|
||||
|
||||
interface Params {
|
||||
albumName: string;
|
||||
@ -252,7 +252,7 @@ export struct TimelinePage {
|
||||
Log.error(TAG, 'targetIndex is not found');
|
||||
return;
|
||||
}
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
if (geometryTapIndex !== undefined && geometryTransitionString !== undefined) {
|
||||
this.jumpToPhotoBrowserGeometryTransition(targetIndex, name, item, geometryTapIndex, geometryTransitionString);
|
||||
} else {
|
||||
@ -267,8 +267,8 @@ export struct TimelinePage {
|
||||
return;
|
||||
}
|
||||
Log.info(TAG, `JUMP_THIRD_PHOTO_BROWSER.index: ${targetIndex} transition: ${name}`);
|
||||
AppStorage.SetOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
if (geometryTapIndex !== undefined && geometryTransitionString !== undefined) {
|
||||
this.jumpToSelectPhotoBrowserGeometryTransition(
|
||||
targetIndex, name, item, geometryTapIndex, geometryTransitionString);
|
||||
|
@ -32,7 +32,7 @@ export struct TimelineTitleComponent {
|
||||
}
|
||||
|
||||
selectStateChange() {
|
||||
AppStorage.SetOrCreate('focusUpdate', true);
|
||||
AppStorage.setOrCreate('focusUpdate', true);
|
||||
Log.info(TAG, 'change selected.');
|
||||
this.broadCast.emit(BroadCastConstants.GROUP_SELECT, [this.mPosition]);
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ export default class MainAbility extends Ability {
|
||||
|
||||
parseWantParameter(isOnNewWant: boolean, want: Want): void {
|
||||
Log.info(TAG, `Application isOnNewWant=${isOnNewWant}, want=${JSON.stringify(want)}`);
|
||||
AppStorage.SetOrCreate('placeholderIndex', -1);
|
||||
AppStorage.setOrCreate('placeholderIndex', -1);
|
||||
this.formCurrentUri = '';
|
||||
this.formAlbumUri = '';
|
||||
let wantParam: { [key: string]: Object } = want.parameters;
|
||||
@ -98,7 +98,7 @@ export default class MainAbility extends Ability {
|
||||
if (wantParamUri === Constants.WANT_PARAM_URI_DETAIL) {
|
||||
isFromCamera = true;
|
||||
if (isOnNewWant) {
|
||||
AppStorage.SetOrCreate('entryFromHapCamera', Constants.ENTRY_FROM_CAMERA);
|
||||
AppStorage.setOrCreate('entryFromHapCamera', Constants.ENTRY_FROM_CAMERA);
|
||||
AppStorage.get<window.WindowStage>('photosWindowStage').loadContent('pages/PhotoBrowser', (err, data) => {
|
||||
if (err.code) {
|
||||
Log.error(TAG, 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
|
||||
@ -107,7 +107,7 @@ export default class MainAbility extends Ability {
|
||||
Log.info(TAG, 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
|
||||
});
|
||||
} else {
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_CAMERA);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_CAMERA);
|
||||
}
|
||||
} else if (wantParamUri === Constants.WANT_PARAM_URI_SELECT_SINGLE) {
|
||||
mCallerBundleName = wantParam[Constants.KEY_WANT_PARAMETERS_CALLER_BUNDLE_NAME] as string;
|
||||
@ -115,7 +115,7 @@ export default class MainAbility extends Ability {
|
||||
// Max select count must be 1 in single select mode
|
||||
mMaxSelectCount = Constants.NUMBER_1;
|
||||
mFilterMediaType = wantParam?.filterMediaType as string;
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_SINGLE_SELECT);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_SINGLE_SELECT);
|
||||
cameraAble = (wantParam?.isPhotoTakingSupported as boolean) ?? true;
|
||||
editAble = (wantParam?.isEditSupported as boolean) ?? true;
|
||||
SmartPickerUtils.initIfNeeded(this.context, want, this.localStorage);
|
||||
@ -123,43 +123,43 @@ export default class MainAbility extends Ability {
|
||||
mCallerBundleName = wantParam[Constants.KEY_WANT_PARAMETERS_CALLER_BUNDLE_NAME] as string;
|
||||
mMaxSelectCount = wantParam?.maxSelectCount as number;
|
||||
mFilterMediaType = wantParam?.filterMediaType as string;
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_MULTIPLE_SELECT);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_MULTIPLE_SELECT);
|
||||
cameraAble = (wantParam?.isPhotoTakingSupported as boolean) ?? true;
|
||||
editAble = (wantParam?.isEditSupported as boolean) ?? true;
|
||||
SmartPickerUtils.initIfNeeded(this.context, want, this.localStorage);
|
||||
} else if (wantParamUri === Constants.WANT_PARAM_URI_FORM) {
|
||||
isFromCard = true;
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_FORM_ABILITY);
|
||||
AppStorage.SetOrCreate('form_albumUri', wantParam?.albumUri);
|
||||
AppStorage.SetOrCreate('form_currentUri', wantParam?.currentUri);
|
||||
AppStorage.SetOrCreate('form_displayName', wantParam?.displayName);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_FORM_ABILITY);
|
||||
AppStorage.setOrCreate('form_albumUri', wantParam?.albumUri);
|
||||
AppStorage.setOrCreate('form_currentUri', wantParam?.currentUri);
|
||||
AppStorage.setOrCreate('form_displayName', wantParam?.displayName);
|
||||
this.formAlbumUri = wantParam?.albumUri as string;
|
||||
this.formCurrentUri = wantParam?.currentUri as string;
|
||||
} else if (wantParam?.formId) {
|
||||
AppStorage.SetOrCreate('FASetting_FormId', wantParam.formId);
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_FORM_FORM_EDITOR);
|
||||
AppStorage.setOrCreate('FASetting_FormId', wantParam.formId);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_FORM_FORM_EDITOR);
|
||||
} else if (want.action === wantConstant.Action.ACTION_VIEW_DATA) {
|
||||
isShowMenuFromThirdView = wantParam.isShowMenu as boolean;
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_VIEW_DATA);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_VIEW_DATA);
|
||||
if (want.uri) {
|
||||
AppStorage.SetOrCreate('viewDataUri', want.uri);
|
||||
AppStorage.setOrCreate('viewDataUri', want.uri);
|
||||
} else {
|
||||
AppStorage.SetOrCreate('viewDataUri', wantParamUri);
|
||||
AppStorage.setOrCreate('viewDataUri', wantParamUri);
|
||||
}
|
||||
if (wantParam?.albumUri) {
|
||||
AppStorage.SetOrCreate('viewDataAlbumUri', wantParam.albumUri);
|
||||
AppStorage.setOrCreate('viewDataAlbumUri', wantParam.albumUri);
|
||||
} else {
|
||||
AppStorage.SetOrCreate('viewDataAlbumUri', '');
|
||||
AppStorage.setOrCreate('viewDataAlbumUri', '');
|
||||
}
|
||||
if (wantParam?.viewIndex) {
|
||||
AppStorage.SetOrCreate('viewDataIndex', wantParam.viewIndex);
|
||||
AppStorage.setOrCreate('viewDataIndex', wantParam.viewIndex);
|
||||
} else {
|
||||
AppStorage.SetOrCreate('viewDataIndex', '');
|
||||
AppStorage.setOrCreate('viewDataIndex', '');
|
||||
}
|
||||
} else if (wantParamUri === Constants.WANT_PARAM_URI_FORM_NONE) {
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_FORM_DEFAULT_ABILITY);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_FORM_DEFAULT_ABILITY);
|
||||
} else {
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,20 +179,20 @@ export default class MainAbility extends Ability {
|
||||
// Main window is created, set main page for this ability
|
||||
Log.info(TAG, 'Application onWindowStageCreate');
|
||||
AppStorage.setOrCreate('photosWindowStage', windowStage);
|
||||
AppStorage.SetOrCreate('deviceType',
|
||||
AppStorage.setOrCreate('deviceType',
|
||||
deviceInfo.deviceType == ('phone' || 'default') ? Constants.DEFAULT_DEVICE_TYPE : Constants.PAD_DEVICE_TYPE);
|
||||
ScreenManager.getInstance().on(ScreenManager.ON_LEFT_BLANK_CHANGED, data => {
|
||||
Log.info(TAG, `onleftBlankChanged: ${data}`);
|
||||
AppStorage.SetOrCreate('leftBlank', data);
|
||||
AppStorage.setOrCreate('leftBlank', data);
|
||||
});
|
||||
ScreenManager.getInstance().on(ScreenManager.ON_SPLIT_MODE_CHANGED, mode => {
|
||||
Log.info(TAG, `onSplitModeChanged: ${JSON.stringify(mode)}`);
|
||||
ReportToBigDataUtil.report(BigDataConstants.SPLIT_SCREEN_ID, null);
|
||||
AppStorage.SetOrCreate('isSplitMode', mode);
|
||||
AppStorage.setOrCreate('isSplitMode', mode);
|
||||
});
|
||||
Log.info(TAG, 'Application onCreate finish');
|
||||
windowStage.getMainWindow().then((win) => {
|
||||
AppStorage.SetOrCreate('mainWindow', win);
|
||||
AppStorage.setOrCreate('mainWindow', win);
|
||||
ScreenManager.getInstance().getAvoidArea();
|
||||
ScreenManager.getInstance().initializationSize(win).then(() => {
|
||||
ScreenManager.getInstance().initWindowMode();
|
||||
@ -285,7 +285,7 @@ export default class MainAbility extends Ability {
|
||||
new MediaDataSource(Constants.DEFAULT_SLIDING_WIN_SIZE);
|
||||
dataSource.setAlbumUri(this.formAlbumUri);
|
||||
dataSource.initialize();
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, dataSource);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, dataSource);
|
||||
} else {
|
||||
let dataSource: MediaDataSource =
|
||||
new MediaDataSource(Constants.DEFAULT_SLIDING_WIN_SIZE);
|
||||
@ -296,7 +296,7 @@ export default class MainAbility extends Ability {
|
||||
const DELAY_TIME: number = 50;
|
||||
let intervalId = setInterval(() => {
|
||||
if (dataSource.getRawData(0) || times >= COUNT_NUM) {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, dataSource);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, dataSource);
|
||||
let options = {
|
||||
url: 'pages/PhotoBrowser',
|
||||
params: {
|
||||
@ -334,7 +334,7 @@ export default class MainAbility extends Ability {
|
||||
};
|
||||
router.replaceUrl(options);
|
||||
}
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE)
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE)
|
||||
}
|
||||
|
||||
private initPhotosPref(): void {
|
||||
@ -342,11 +342,11 @@ export default class MainAbility extends Ability {
|
||||
data_preferences.getPreferences(AppStorage.get<common.UIAbilityContext>('photosAbilityContext'), Constants.PHOTOS_STORE_KEY)
|
||||
.then((pref: data_preferences.Preferences) => {
|
||||
pref.get(Constants.IS_FIRST_TIME_DELETE, true).then((data: boolean) => {
|
||||
AppStorage.SetOrCreate<boolean>(Constants.IS_FIRST_TIME_DELETE, data);
|
||||
AppStorage.setOrCreate<boolean>(Constants.IS_FIRST_TIME_DELETE, data);
|
||||
}).catch((err) => {
|
||||
Log.error(TAG, `Failed to get whether first time delete, err: ${err}`);
|
||||
});
|
||||
AppStorage.SetOrCreate<data_preferences.Preferences>(Constants.PHOTOS_STORE_KEY, pref)
|
||||
AppStorage.setOrCreate<data_preferences.Preferences>(Constants.PHOTOS_STORE_KEY, pref)
|
||||
})
|
||||
.catch((err) => {
|
||||
Log.error(TAG, 'Failed to get preferences.');
|
||||
|
@ -30,8 +30,8 @@ export default class ServiceExtAbility extends Extension {
|
||||
Log.info(TAG, 'ServiceExtAbility want param:' + JSON.stringify(want));
|
||||
AppStorage.setOrCreate('windowClass', null);
|
||||
AppStorage.setOrCreate('photosAbilityContext', this.context);
|
||||
AppStorage.SetOrCreate(Constants.SCREEN_SIDEBAR, false);
|
||||
AppStorage.SetOrCreate('deviceType', Constants.PC_DEVICE_TYPE);
|
||||
AppStorage.setOrCreate(Constants.SCREEN_SIDEBAR, false);
|
||||
AppStorage.setOrCreate('deviceType', Constants.PC_DEVICE_TYPE);
|
||||
}
|
||||
|
||||
onReconnect(want: Want): void {
|
||||
@ -70,8 +70,8 @@ export default class ServiceExtAbility extends Extension {
|
||||
if (!uris?.length) {
|
||||
return;
|
||||
}
|
||||
AppStorage.SetOrCreate('uris', uris);
|
||||
AppStorage.SetOrCreate('appName', appName);
|
||||
AppStorage.setOrCreate('uris', uris);
|
||||
AppStorage.setOrCreate('appName', appName);
|
||||
this.windowClass = AppStorage.get('windowClassg');
|
||||
let config: Window.Configuration = {
|
||||
name: 'DeleteDialog ' + appName + Math.random(), windowType: Window.WindowType.TYPE_DIALOG, ctx: this.context
|
||||
@ -97,7 +97,7 @@ export default class ServiceExtAbility extends Extension {
|
||||
Log.info(TAG, 'requestInfo param:' + JSON.stringify(requestInfo));
|
||||
|
||||
let requestCallback: dialogRequest.RequestCallback = dialogRequest.getRequestCallback(want);
|
||||
AppStorage.SetOrCreate('requestCallback', requestCallback);
|
||||
AppStorage.setOrCreate('requestCallback', requestCallback);
|
||||
|
||||
this.windowClass.bindDialogTarget(requestInfo, (): void => { //绑定模态窗口与目标窗口
|
||||
Log.info(TAG, 'Dialog Window Need Destroy.');
|
||||
|
@ -87,17 +87,17 @@ export struct AlbumSelect {
|
||||
this.newAlbumName = param.albumName;
|
||||
this.currentAlbumUri = param.albumUri;
|
||||
if (param.isNewAlbum) {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM, true);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM, true);
|
||||
} else {
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM, false);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM, false);
|
||||
}
|
||||
}
|
||||
this.albums.setBlackList([this.currentAlbumUri, UserFileManagerAccess.getInstance()
|
||||
.getSystemAlbumUri(UserFileManagerAccess.TRASH_ALBUM_SUB_TYPE)]);
|
||||
Log.info(TAG, `the album uri is: ${this.currentAlbumUri}`);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM_TARGET, this.newAlbumName);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM_TARGET_URI, this.currentAlbumUri);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM_SELECTED, this.mSelectManager);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM_TARGET, this.newAlbumName);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM_TARGET_URI, this.currentAlbumUri);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM_SELECTED, this.mSelectManager);
|
||||
TraceControllerUtils.finishTrace('AlbumSetPageAboutToAppear');
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ import { PhotoBrowserComponent } from '../view/PhotoBrowserComponent';
|
||||
import { SelectPhotoBrowserView } from '../view/SelectPhotoBrowserView';
|
||||
|
||||
const TAG: string = 'NewAlbumPage';
|
||||
AppStorage.SetOrCreate('PhotoGridPageIndex', Constants.INVALID);
|
||||
AppStorage.setOrCreate('PhotoGridPageIndex', Constants.INVALID);
|
||||
|
||||
interface Params {
|
||||
item: string;
|
||||
@ -108,7 +108,7 @@ export struct NewAlbumPage {
|
||||
return;
|
||||
}
|
||||
Log.info(TAG, `jump to photo browser at index: ${targetIndex}`);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
interface Params {
|
||||
position: number;
|
||||
transition: string;
|
||||
@ -125,8 +125,8 @@ export struct NewAlbumPage {
|
||||
private jumpThirdPhotoBrowser(name: string, item: MediaItem, geometryTapIndex: number, geometryTransitionString: string): void {
|
||||
let targetIndex = this.dataSource.getDataIndex(item);
|
||||
Log.info(TAG, `jump to photo browser, index: ${targetIndex}, transition: ${name}`);
|
||||
AppStorage.SetOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
interface Params {
|
||||
position: number;
|
||||
transition: string;
|
||||
@ -180,7 +180,7 @@ export struct NewAlbumPage {
|
||||
}
|
||||
Log.info(TAG, `onMenuClicked, action: ${action.actionID} newAlbum: ${this.isNewAlbum}`);
|
||||
if (this.isNewAlbum) {
|
||||
AppStorage.SetOrCreate(Constants.IS_SHOW_MOVE_COPY_DIALOG, true);
|
||||
AppStorage.setOrCreate(Constants.IS_SHOW_MOVE_COPY_DIALOG, true);
|
||||
let url = 'pages/index';
|
||||
router.back({
|
||||
url: url,
|
||||
@ -265,7 +265,7 @@ export struct NewAlbumPage {
|
||||
this.mSelectManager = AppStorage.Get<SelectManager>(Constants.APP_KEY_NEW_ALBUM_SELECTED) as SelectManager;
|
||||
if (this.mSelectManager == null) {
|
||||
this.mSelectManager = new SelectManager();
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM_SELECTED, this.mSelectManager);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM_SELECTED, this.mSelectManager);
|
||||
}
|
||||
let param: Params = router.getParams() as Params;
|
||||
if (param != null) {
|
||||
@ -273,7 +273,7 @@ export struct NewAlbumPage {
|
||||
let item: AlbumInfo = JSON.parse(param.item) as AlbumInfo;
|
||||
this.title = item.albumName;
|
||||
this.dataSource.setAlbumUri(item.uri);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM_SOURCE, item.uri);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM_SOURCE, item.uri);
|
||||
} else {
|
||||
this.title = '';
|
||||
this.dataSource.setAlbumUri("");
|
||||
@ -291,7 +291,7 @@ export struct NewAlbumPage {
|
||||
this.broadCast.on(BroadCastConstants.ON_DATA_RELOADED, this.onLoadingFinishedFunc);
|
||||
|
||||
this.appBroadCast.on(BroadCastConstants.UPDATE_DATA_SOURCE, this.onUpdateFavorStateFunc);
|
||||
AppStorage.SetOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.setOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
this.mSelectManager.registerCallback('allSelect', (newState: boolean) => {
|
||||
Log.info(TAG, `allSelect ${newState}`);
|
||||
this.isDataFreeze = AppStorage.get<boolean>(Constants.IS_DATA_FREEZE) as boolean;
|
||||
|
@ -29,7 +29,7 @@ import { SelectPhotoBrowserView } from '../view/SelectPhotoBrowserView';
|
||||
import { LEFT_BLANK } from '@ohos/thirdselect/src/main/ets/default/utils/ThirdSelectConstants';
|
||||
|
||||
const TAG: string = 'PhotoGridPage';
|
||||
AppStorage.SetOrCreate('PhotoGridPageIndex', Constants.INVALID);
|
||||
AppStorage.setOrCreate('PhotoGridPageIndex', Constants.INVALID);
|
||||
|
||||
// Album Page
|
||||
@Entry
|
||||
|
@ -215,7 +215,7 @@ struct IndexPage {
|
||||
// To help AlbumSetPage show copy or move dialog
|
||||
if (AppStorage.get<boolean>(Constants.IS_SHOW_MOVE_COPY_DIALOG)) {
|
||||
this.appBroadCast.emit(BroadCastConstants.SEND_COPY_OR_MOVE_BROADCAST, [this.currentIndex]);
|
||||
AppStorage.SetOrCreate(Constants.IS_SHOW_MOVE_COPY_DIALOG, false);
|
||||
AppStorage.setOrCreate(Constants.IS_SHOW_MOVE_COPY_DIALOG, false);
|
||||
}
|
||||
}
|
||||
this.pageStatus = true;
|
||||
@ -313,8 +313,8 @@ struct IndexPage {
|
||||
.barHeight(Constants.NUMBER_0)
|
||||
.flexGrow(Constants.NUMBER_1)
|
||||
.onChange((index: number) => {
|
||||
AppStorage.SetOrCreate<string>(Constants.KEY_OF_ALBUM_ID, '');
|
||||
AppStorage.SetOrCreate<string>(Constants.KEY_OF_ALBUM_URI, '');
|
||||
AppStorage.setOrCreate<string>(Constants.KEY_OF_ALBUM_ID, '');
|
||||
AppStorage.setOrCreate<string>(Constants.KEY_OF_ALBUM_URI, '');
|
||||
this.resetTabState(this.currentIndex)
|
||||
this.onTabChanged(index);
|
||||
Log.info(TAG, `Switch to Tab ${this.currentIndex}.`)
|
||||
|
@ -270,7 +270,7 @@ export struct PhotoBrowserComponent {
|
||||
}
|
||||
this.updateMenu();
|
||||
this.geometryTransitionId = this.browserController.pageFrom + currentPhoto.getHashCode() + 'false';
|
||||
AppStorage.SetOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
AppStorage.setOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
} else if (actionID === Action.DELETE.actionID) {
|
||||
if (currentPhoto == undefined) {
|
||||
Log.warn(TAG, 'currentPhoto is undefined.');
|
||||
@ -397,9 +397,9 @@ export struct PhotoBrowserComponent {
|
||||
Log.error(TAG, 'onPhotoChanged, item is undefined');
|
||||
} else {
|
||||
let timelineIndex = this.dataSource.getPositionByIndex(index);
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', timelineIndex);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', timelineIndex);
|
||||
this.geometryTransitionId = this.browserController.pageFrom + currentPhoto.getHashCode() + 'false';
|
||||
AppStorage.SetOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
AppStorage.setOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
Log.debug(TAG, `onPhotoChanged, index: ${index}, currentPhoto: ${currentPhoto.uri}, \
|
||||
placeholderIndex ${AppStorage.get<number>('placeholderIndex') as number},\
|
||||
geometryTransitionBrowserId ${this.geometryTransitionId}, this.mTransition ${this.mTransition}, \
|
||||
@ -742,7 +742,7 @@ export struct PhotoBrowserComponent {
|
||||
param = {
|
||||
pageFrom: Constants.ENTRY_FROM.CAMERA
|
||||
} as ParamBrowser;
|
||||
AppStorage.SetOrCreate('entryFromHapCamera', Constants.ENTRY_FROM_NONE);
|
||||
AppStorage.setOrCreate('entryFromHapCamera', Constants.ENTRY_FROM_NONE);
|
||||
}
|
||||
|
||||
if (param) {
|
||||
@ -764,7 +764,7 @@ export struct PhotoBrowserComponent {
|
||||
this.albumUri = "";
|
||||
this.jumpSourceToMain = JumpSourceToMain.CAMERA;
|
||||
MediaObserver.getInstance().registerObserver(this.dataObserver);
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE);
|
||||
} else if (this.pageFrom == Constants.ENTRY_FROM.CARD) {
|
||||
this.dataSource = new PhotoDataSource();
|
||||
this.albumUri = param.albumUri;
|
||||
@ -863,7 +863,7 @@ export struct PhotoBrowserComponent {
|
||||
this.albumUri = UserFileManagerAccess.getInstance()
|
||||
.getSystemAlbumUri(UserFileManagerAccess.IMAGE_ALBUM_SUB_TYPE);
|
||||
}
|
||||
AppStorage.SetOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE);
|
||||
AppStorage.setOrCreate('entryFromHap', Constants.ENTRY_FROM_NONE);
|
||||
let albumDataSource: MediaDataSource = AppStorage.get<MediaDataSource>(Constants.APP_KEY_PHOTO_BROWSER) as MediaDataSource;
|
||||
if (albumDataSource) {
|
||||
this.dataSource.setAlbumDataSource(albumDataSource);
|
||||
|
@ -67,7 +67,7 @@ import {
|
||||
|
||||
|
||||
const TAG: string = 'PhotoGridView';
|
||||
AppStorage.SetOrCreate('PhotoGridPageIndex', Constants.INVALID);
|
||||
AppStorage.setOrCreate('PhotoGridPageIndex', Constants.INVALID);
|
||||
|
||||
// Album View
|
||||
@Component
|
||||
@ -153,29 +153,29 @@ export struct PhotoGridView {
|
||||
delay: BrowserConstants.PHONE_LINK_ALBUM_ACTIONBAR_DELAY,
|
||||
curve: Curve.Sharp
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_ALBUM_ACTIONBAR_OPACITY, 1);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_ALBUM_ACTIONBAR_OPACITY, 1);
|
||||
})
|
||||
animateTo({
|
||||
duration: BrowserConstants.PHONE_LINK_OUT_PHOTO_GRID_ACTIONBAR_DURATION,
|
||||
curve: Curve.Sharp
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_ACTIONBAR_OPACITY, 0);
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_VIEW_OPACITY, 0);
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_ALBUM_OPACITY, 1);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_ACTIONBAR_OPACITY, 0);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_PHOTO_GRID_VIEW_OPACITY, 0);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_ALBUM_OPACITY, 1);
|
||||
})
|
||||
animateTo({
|
||||
duration: BrowserConstants.PHONE_LINK_PHOTO_GRID_TO_ALBUM_DURATION,
|
||||
curve: Curve.Friction
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_SELECTED_ALBUM_INDEX, -1);
|
||||
AppStorage.SetOrCreate<boolean>(Constants.KEY_OF_IS_SHOW_PHOTO_GRID_VIEW, false);
|
||||
AppStorage.SetOrCreate<string>(Constants.KEY_OF_SELECTED_ALBUM_URI, '');
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_SELECTED_ALBUM_INDEX, -1);
|
||||
AppStorage.setOrCreate<boolean>(Constants.KEY_OF_IS_SHOW_PHOTO_GRID_VIEW, false);
|
||||
AppStorage.setOrCreate<string>(Constants.KEY_OF_SELECTED_ALBUM_URI, '');
|
||||
})
|
||||
animateTo({
|
||||
duration: BrowserConstants.PHONE_LINK_PHOTO_GRID_TO_ALBUM_SCALE_DURATION,
|
||||
curve: Curve.Friction
|
||||
}, () => {
|
||||
AppStorage.SetOrCreate<number>(Constants.KEY_OF_ALBUM_OTHER_SCALE, 1);
|
||||
AppStorage.setOrCreate<number>(Constants.KEY_OF_ALBUM_OTHER_SCALE, 1);
|
||||
})
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ export struct PhotoGridView {
|
||||
this.appBroadCast.off(BroadCastConstants.DO_ANIMATION, null);
|
||||
});
|
||||
|
||||
AppStorage.SetOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.setOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
this.mSelectManager.registerCallback('allSelect', (newState: boolean) => {
|
||||
Log.info(TAG, `allSelect ${newState}`);
|
||||
if (this.isDataFreeze) {
|
||||
@ -646,7 +646,7 @@ export struct PhotoGridView {
|
||||
pageEntryFrom = Constants.ENTRY_FROM.DISTRIBUTED;
|
||||
}
|
||||
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
if (geometryTapIndex !== undefined && geometryTransitionString !== undefined) {
|
||||
this.jumpToPhotoBrowserGeometryTransition(
|
||||
targetIndex, name, pageEntryFrom, geometryTapIndex, geometryTransitionString);
|
||||
@ -669,8 +669,8 @@ export struct PhotoGridView {
|
||||
} else if (this.isDistributedAlbum) {
|
||||
pageEntryFrom = Constants.ENTRY_FROM.DISTRIBUTED;
|
||||
}
|
||||
AppStorage.SetOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
AppStorage.setOrCreate(Constants.PHOTO_GRID_SELECT_MANAGER, this.mSelectManager);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_PHOTO_BROWSER, this.dataSource);
|
||||
if (geometryTapIndex !== undefined && geometryTransitionString !== undefined) {
|
||||
this.jumpToSelectPhotoBrowserGeometryTransition(
|
||||
targetIndex, name, pageEntryFrom, geometryTapIndex, geometryTransitionString);
|
||||
@ -698,7 +698,7 @@ export struct PhotoGridView {
|
||||
|
||||
updateFirstPhotoItemInfo(item: MediaItem, isFirstPhotoItem: boolean): void {
|
||||
if (item) {
|
||||
AppStorage.SetOrCreate<boolean>(Constants.KEY_OF_IS_FIRST_PHOTO_ITEM, isFirstPhotoItem);
|
||||
AppStorage.setOrCreate<boolean>(Constants.KEY_OF_IS_FIRST_PHOTO_ITEM, isFirstPhotoItem);
|
||||
let albumUri = AppStorage.Get<string>(Constants.KEY_OF_ALBUM_URI);
|
||||
let transitionId = `${item.hashCode}_${albumUri}`;
|
||||
Log.info(TAG, `updateFirstPhotoItemInfo transitionId: ${transitionId}`);
|
||||
@ -980,7 +980,7 @@ export struct PhotoGridView {
|
||||
.withTargetAlbumName(albumName)
|
||||
.withAlbumUri(albumUri);
|
||||
let menuOperation = MenuOperationFactory.getInstance().createMenuOperation(MoveMenuOperation, menuContext);
|
||||
AppStorage.SetOrCreate(Constants.APP_KEY_NEW_ALBUM_SOURCE, this.albumInfo.uri);
|
||||
AppStorage.setOrCreate(Constants.APP_KEY_NEW_ALBUM_SOURCE, this.albumInfo.uri);
|
||||
menuOperation.doAction();
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ export struct SelectPhotoBrowserView {
|
||||
}
|
||||
|
||||
onGeometryChanged() {
|
||||
AppStorage.SetOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
AppStorage.setOrCreate<string>('geometryTransitionBrowserId', this.geometryTransitionId);
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
@ -189,7 +189,7 @@ export struct SelectPhotoBrowserView {
|
||||
Log.error(TAG, 'onPhotoChanged, item is undefined');
|
||||
} else {
|
||||
this.isSelected = this.selectManager?.isItemSelected(currentPhoto.uri, this.timelineIndex) ?? false;
|
||||
AppStorage.SetOrCreate<number>('placeholderIndex', this.timelineIndex);
|
||||
AppStorage.setOrCreate<number>('placeholderIndex', this.timelineIndex);
|
||||
this.geometryTransitionId = this.browserController.pageFrom + currentPhoto.getHashCode() + this.isSelected;
|
||||
Log.info(TAG, `onPhotoChanged, index: ${index}, currentPhoto: ${currentPhoto.uri},\
|
||||
isSelected: ${this.isSelected} geometryTransitionId ${this.geometryTransitionId}`);
|
||||
|
Loading…
Reference in New Issue
Block a user