mirror of
https://gitee.com/openharmony/applications_photos
synced 2024-11-27 09:12:32 +00:00
!490 【master】【OpenHarmony 4.0.10.15】【应用子系统】【标准系统】【必现_5/5】大图浏览和宫格界面选择状态不一致
Merge pull request !490 from liujuan/master
This commit is contained in:
commit
68bc1e3eed
@ -23,6 +23,7 @@ export class BroadCastConstants {
|
||||
static readonly UPDATE_PROGRESS: string = 'updateProgress';
|
||||
static readonly CANCEL_DELETE: string = 'cancelDelete';
|
||||
static readonly JUMP_THIRD_PHOTO_BROWSER: string = 'jumpThirdPhotoPage';
|
||||
static readonly UPDATE_SELECT: string = 'updateSelect';
|
||||
static readonly BACK_PRESS_EVENT: string = 'back';
|
||||
static readonly RESET_STATE_EVENT: string = 'resetState';
|
||||
static readonly ON_TAB_CHANGED: string = 'onTabChanged';
|
||||
|
@ -80,6 +80,8 @@ export struct ImageGridItemComponent {
|
||||
private dataSource: MediaDataSource | null = null;
|
||||
private geometryTapIndex: number = 0;
|
||||
private isTapStatusChange: boolean = false;
|
||||
private appBroadCast: BroadCast = BroadCastManager.getInstance().getBroadCast();
|
||||
private updateSelectFunc: Function = (updateUri: string, select: boolean): void => this.updateSelect(updateUri, select);
|
||||
|
||||
verifyTapStatus() {
|
||||
if (this.placeholderIndex === Constants.INVALID) {
|
||||
@ -116,9 +118,17 @@ export struct ImageGridItemComponent {
|
||||
}
|
||||
Log.info(TAG, `transitionId: ${this.transitionId}`);
|
||||
this.isTap = this.geometryTransitionString === this.geometryTransitionBrowserId;
|
||||
this.appBroadCast.on(BroadCastConstants.UPDATE_SELECT, this.updateSelectFunc);
|
||||
}
|
||||
|
||||
updateSelect(updateUri: string, select: boolean): void {
|
||||
if (updateUri === this.item?.uri) {
|
||||
this.isSelected = select;
|
||||
}
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
this.appBroadCast.off(BroadCastConstants.UPDATE_SELECT, this.updateSelectFunc);
|
||||
this.resetPressAnim();
|
||||
}
|
||||
|
||||
|
@ -221,6 +221,7 @@ export struct ThirdSelectPhotoBrowserBase {
|
||||
}
|
||||
this.totalSelectedCount = this.selectManager?.getSelectedCount() ?? 0;
|
||||
this.geometryTransitionId = this.browserController.pageFrom + currentPhoto.getHashCode() + this.isSelected;
|
||||
this.appBroadCast.emit(BroadCastConstants.UPDATE_SELECT, [currentPhoto.uri, this.isSelected]);
|
||||
Log.info(TAG, `totalSelectedCount: ${this.totalSelectedCount} after state change geometryTransitionId ${this.geometryTransitionId}`);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user