mirror of
https://gitee.com/openharmony/applications_photos
synced 2024-11-27 09:12:32 +00:00
Partial fix 140: folder features
Signed-off-by: Ivan Tyulyandin <ivan.tyulyandin@huawei.com>
This commit is contained in:
parent
9ff1b5d24a
commit
ac5b8a5c53
@ -45,8 +45,8 @@ export class AlbumSetDeleteMenuOperation extends ProcessMenuOperation {
|
||||
return;
|
||||
}
|
||||
|
||||
this.confirmCallback = this.confirmCallback.bind(this);
|
||||
this.cancelCallback = this.cancelCallback.bind(this);
|
||||
this.confirmCallback = (): void => this.confirmCallbackBindImpl();
|
||||
this.cancelCallback = (): void => this.cancelCallbackBindImpl();
|
||||
|
||||
let deleteResource: Resource = $r('app.string.dialog_delete');
|
||||
this.getDialogTitle().then((dialogTitle: Resource): void => {
|
||||
@ -99,6 +99,10 @@ export class AlbumSetDeleteMenuOperation extends ProcessMenuOperation {
|
||||
}
|
||||
|
||||
private confirmCallback(): void {
|
||||
this.confirmCallbackBindImpl()
|
||||
}
|
||||
|
||||
private confirmCallbackBindImpl(): void {
|
||||
Log.info(TAG, 'AlbumSet delete confirm');
|
||||
// 1. Variable initialization
|
||||
this.onOperationEnd = this.menuContext.onOperationEnd;
|
||||
@ -111,6 +115,10 @@ export class AlbumSetDeleteMenuOperation extends ProcessMenuOperation {
|
||||
}
|
||||
|
||||
private cancelCallback(): void {
|
||||
this.cancelCallbackBindImpl()
|
||||
}
|
||||
|
||||
private cancelCallbackBindImpl(): void {
|
||||
Log.info(TAG, 'AlbumSet delete cancel');
|
||||
}
|
||||
}
|
||||
|
@ -60,8 +60,8 @@ export class AlbumSetRenameMenuOperation implements MenuOperation, MenuOperation
|
||||
|
||||
this.item = items[0] as AlbumDataItem;
|
||||
|
||||
this.confirmCallback = this.confirmCallback.bind(this);
|
||||
this.cancelCallback = this.cancelCallback.bind(this);
|
||||
this.confirmCallback = (newName: string): Promise<void> => this.confirmCallbackBindImpl(newName);
|
||||
this.cancelCallback = (): void => this.cancelCallbackBindImpl();
|
||||
|
||||
Log.info(TAG, "The name of clicked album is " + this.item.displayName);
|
||||
|
||||
@ -70,6 +70,10 @@ export class AlbumSetRenameMenuOperation implements MenuOperation, MenuOperation
|
||||
}
|
||||
|
||||
private async confirmCallback(newName: string): Promise<void> {
|
||||
return await this.confirmCallbackBindImpl(newName)
|
||||
}
|
||||
|
||||
private async confirmCallbackBindImpl(newName: string): Promise<void> {
|
||||
Log.info(TAG, "AlbumSet rename confirm and the new name is: " + newName);
|
||||
|
||||
this.onOperationEnd = this.menuContext.onOperationEnd;
|
||||
@ -111,6 +115,10 @@ export class AlbumSetRenameMenuOperation implements MenuOperation, MenuOperation
|
||||
}
|
||||
|
||||
private cancelCallback(): void {
|
||||
this.cancelCallbackBindImpl()
|
||||
}
|
||||
|
||||
private cancelCallbackBindImpl(): void {
|
||||
Log.info(TAG, 'AlbumSet rename cancel');
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ export struct PhotoItem {
|
||||
aboutToAppear(): void {
|
||||
Log.info(TAG, "aboutToAppear");
|
||||
this.timeStamp = (new Date()).valueOf().toString();
|
||||
this.eventPipeline = new EventPipeline(this.broadCast, this.item, this.timeStamp, this.updateMatrix.bind(this));
|
||||
this.eventPipeline = new EventPipeline(this.broadCast, this.item, this.timeStamp, (m: Matrix4.Matrix4Transit): void => this.updateMatrixBindImpl(m));
|
||||
this.matrix = Matrix4.identity().copy();
|
||||
this.firstLoad = true;
|
||||
this.isLoading = true;
|
||||
@ -109,7 +109,11 @@ export struct PhotoItem {
|
||||
Log.info(TAG, "photoItem aboutToAppear " + this.item.uri + " end " + this.item.orientation);
|
||||
}
|
||||
|
||||
private updateMatrix(matrix) {
|
||||
private updateMatrix(matrix: Matrix4.Matrix4Transit) {
|
||||
this.updateMatrixBindImpl(matrix)
|
||||
}
|
||||
|
||||
private updateMatrixBindImpl(matrix: Matrix4.Matrix4Transit) {
|
||||
Log.info(TAG, "updateMatrix start " + matrix);
|
||||
this.matrix = matrix;
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ export class RenameMenuOperation implements MenuOperation, MenuOperationCallback
|
||||
return;
|
||||
}
|
||||
|
||||
this.confirmCallback = this.confirmCallback.bind(this);
|
||||
this.cancelCallback = this.cancelCallback.bind(this);
|
||||
this.confirmCallback = (title: string): Promise<void> => this.confirmCallbackBindImpl(title);
|
||||
this.cancelCallback = (): void => this.cancelCallbackBindImpl();
|
||||
let fileName = '';
|
||||
if (mediaItem.title != null) {
|
||||
fileName = mediaItem.title;
|
||||
@ -68,6 +68,10 @@ export class RenameMenuOperation implements MenuOperation, MenuOperationCallback
|
||||
}
|
||||
|
||||
private async confirmCallback(title: string): Promise<void> {
|
||||
return await this.confirmCallbackBindImpl(title)
|
||||
}
|
||||
|
||||
private async confirmCallbackBindImpl(title: string): Promise<void> {
|
||||
Log.info(TAG, "Rename confirm new name: " + title);
|
||||
let mediaItem = (this.menuContext.items[0] as MediaDataItem);
|
||||
if (mediaItem == null) {
|
||||
@ -123,6 +127,10 @@ export class RenameMenuOperation implements MenuOperation, MenuOperationCallback
|
||||
}
|
||||
|
||||
private cancelCallback(): void {
|
||||
this.cancelCallbackBindImpl()
|
||||
}
|
||||
|
||||
private cancelCallbackBindImpl(): void {
|
||||
Log.info(TAG, 'Rename cancel');
|
||||
}
|
||||
}
|
||||
|
@ -110,10 +110,12 @@ export class TimelineItemDataSource extends ItemDataSource {
|
||||
let groupItem: TimelineDataItem = this.groupItem[i]
|
||||
let childLength = groupItem.groupChild.length;
|
||||
if (index == 0) {
|
||||
item = new LazyItem<TimelineDataItem>(groupItem, lazyIndex, this.onTimelineDataUpdate.bind(this));
|
||||
item = new LazyItem<TimelineDataItem>(groupItem, lazyIndex,
|
||||
(index: number, item: TimelineDataItem): void => this.onTimelineDataUpdateBindImpl(index, item));
|
||||
break;
|
||||
} else if (index <= childLength) {
|
||||
item = new LazyItem<MediaDataItem>(groupItem.groupChild[index-1], lazyIndex, this.onMediaDataUpdate.bind(this));
|
||||
item = new LazyItem<MediaDataItem>(groupItem.groupChild[index-1], lazyIndex,
|
||||
(index: number, item: MediaDataItem): void => this.onMediaDataUpdateBindImpl(index, item));
|
||||
groupItem.groupChild[index-1].index = count + index - 1;
|
||||
break;
|
||||
} else {
|
||||
@ -193,6 +195,10 @@ export class TimelineItemDataSource extends ItemDataSource {
|
||||
}
|
||||
|
||||
onTimelineDataUpdate(index: number, item: TimelineDataItem): void {
|
||||
this.onTimelineDataUpdateBindImpl(index, item)
|
||||
}
|
||||
|
||||
private onTimelineDataUpdateBindImpl(index: number, item: TimelineDataItem): void {
|
||||
this.notifyDataChange(index);
|
||||
Log.info(TAG, "onTimelineDataUpdate " + index);
|
||||
for (let i = 0; i < item.groupChild.length; i++) {
|
||||
@ -218,6 +224,10 @@ export class TimelineItemDataSource extends ItemDataSource {
|
||||
}
|
||||
|
||||
onMediaDataUpdate(index: number, item: MediaDataItem): void {
|
||||
this.onMediaDataUpdateBindImpl(index, item)
|
||||
}
|
||||
|
||||
private onMediaDataUpdateBindImpl(index: number, item: MediaDataItem): void {
|
||||
Log.info(TAG, "onMediaDataUpdate " + index);
|
||||
this.notifyDataChange(index);
|
||||
this.notifyDataChange(this.getIndexByMediaIndex(index));
|
||||
|
Loading…
Reference in New Issue
Block a user