mirror of
https://gitee.com/openharmony/applications_photos
synced 2024-11-23 15:10:25 +00:00
Signed-off-by: Fanny <1179195791@qq.com>
Changes to be committed:
This commit is contained in:
parent
22f1447d57
commit
96cf525e5c
@ -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 })
|
||||
|
27
entry/src/main/ets/common/view/components/VideoIcon.ets
Normal file
27
entry/src/main/ets/common/view/components/VideoIcon.ets
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user