Signed-off-by: Fanny <1179195791@qq.com>

Changes to be committed:
This commit is contained in:
Fanny 2022-08-27 17:19:58 +08:00
parent 22f1447d57
commit 96cf525e5c
2 changed files with 46 additions and 19 deletions

View File

@ -24,7 +24,8 @@ import { MediaLibraryAccess } from '../../common/access/MediaLibraryAccess'
import { ScreenManager } from '../model/common/ScreenManager'
import { Constants } from '../model/common/Constants';
import { TraceControllerUtils } from '../utils/TraceControllerUtils';
import { LoadingPanel } from './components/LoadingPanel'
import { LoadingPanel } from './components/LoadingPanel';
import { VideoIcon } from './components/VideoIcon'
@Component
export struct PhotoItem {
@ -337,25 +338,24 @@ export struct PhotoItem {
})
}
Row() {
Image($r('app.media.ic_video_play_btn_png'))
.objectFit(ImageFit.Contain)
.width($r('app.float.icon_video_size'))
.height($r('app.float.icon_video_size'))
.visibility(!this.isLoading ? Visibility.Visible : Visibility.None)
.onClick(() => {
if (this.item != undefined) {
router.push({
uri: 'feature/browser/view/VideoBrowser',
params: {
uri: this.item.uri,
dateTaken: this.item.dateTaken,
previewUri: this.thumbnail
}
})
}
})
.visibility(this.isVideoPlayBtnShow())
VideoIcon()
}
.width($r('app.float.icon_video_size'))
.height($r('app.float.icon_video_size'))
.onClick(() => {
if (this.item != undefined) {
router.push({
uri: 'feature/browser/view/VideoBrowser',
params: {
uri: this.item.uri,
dateTaken: this.item.dateTaken,
previewUri: this.thumbnail
}
})
}
})
.visibility(this.isVideoPlayBtnShow())
}.width('100%')
.height('100%')
.sharedTransition(this.transitionId, { duration: PhotoConstants.SHARE_TRANSITION_DURATION })

View File

@ -0,0 +1,27 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Component
export struct VideoIcon {
@Consume isLoading: boolean;
build() {
Image($r('app.media.ic_video_play_btn_png'))
.objectFit(ImageFit.Contain)
.width($r('app.float.icon_video_size'))
.height($r('app.float.icon_video_size'))
.visibility(!this.isLoading ? Visibility.Visible : Visibility.None)
}
}