From cc330690262a21bb64ab9f7bc8975d65ab2000b1 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Mon, 26 Aug 2024 18:32:18 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3a2dp=E8=BF=9E=E6=8E=A5?= =?utf8?q?=E6=97=B6=E9=9F=B3=E4=B9=90=E6=92=AD=E6=94=BE=E5=99=A8=E7=8A=B6?= =?utf8?q?=E6=80=81=E5=88=B7=E6=96=B0=E5=AF=BC=E8=87=B4=E6=AD=BB=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/player/src/PlayersView.cpp | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp index f981c7dc8..7db9e4edb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp @@ -846,23 +846,26 @@ namespace OHOS // 1.如果为手机音乐且手机音乐已连接那么上一首,下一首,播放或暂停,声音等按钮设置为可点击. // 2.如果不为手机音乐按钮就可点击 /* -------------------------------------------------------------------------- */ - bool touchableState = !musicSourceType; - play_or_pause_Button->SetTouchable(touchableState); - preMusicButton->SetTouchable(touchableState); - nextMusicButton->SetTouchable(touchableState); - soundButton->SetTouchable(touchableState); - playerModelButton->SetTouchable(touchableState); // 如果音乐来源为手机音乐,播放顺序按钮就不可用 - /* -------------------------------------------------------------------------- */ - /*暂停音乐*/ - uint8_t state = GetPlayerButtonState(); - int32_t playerState; /*获取Player的状态*/ - if (state == UICheckBox::UICheckBoxState::SELECTED) - { - PlayersModel::GetInstance()->PlayerStop(); - PlayersModel::GetInstance()->ClearActivateAudioInterrupt(); + if (play_or_pause_Button && preMusicButton && nextMusicButton && soundButton && playerModelButton) + { + bool touchableState = !musicSourceType; + play_or_pause_Button->SetTouchable(touchableState); + preMusicButton->SetTouchable(touchableState); + nextMusicButton->SetTouchable(touchableState); + soundButton->SetTouchable(touchableState); + playerModelButton->SetTouchable(touchableState); // 如果音乐来源为手机音乐,播放顺序按钮就不可用 + /* -------------------------------------------------------------------------- */ + /*暂停音乐*/ + uint8_t state = GetPlayerButtonState(); + int32_t playerState; /*获取Player的状态*/ + if (state == UICheckBox::UICheckBoxState::SELECTED) + { + PlayersModel::GetInstance()->PlayerStop(); + PlayersModel::GetInstance()->ClearActivateAudioInterrupt(); + } + /* -------------------------------------------------------------------------- */ + PreLoadPlayerModeImageRes(); } - /* -------------------------------------------------------------------------- */ - PreLoadPlayerModeImageRes(); } void PlayersView::UpdateMusicListStatus(void) @@ -981,6 +984,7 @@ namespace OHOS MusicSourceLabelSetText(STR_WATCH_MUSIC); /*手表音乐*/ SetMusicPlayerButtonIsTouchable(musicSourceType); } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UpdatePlayerView over!!"); } // 初始化音乐播放器主视图 -- 2.17.1