From afc078db94c2c6b57747c233d65361935839956b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Wed, 4 Dec 2024 08:50:01 +0000 Subject: [PATCH] Merge #1491 into sdk602patch0911 from refs/changes/1491/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/1491/head: (5 commits squashed) - 将主界面进入applist界面Power键触发由释放事件改为按下事件,1.加快界面进入速度;2,解决手表息屏状态下(主界面)按Power键概率性会进入applist界面(需要多台手表验证) - 修复了音乐播放器从本地音乐切到手机音乐后音乐播放按钮显示不正确问题 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 解决音乐播放器界面进入音乐来源视图后在切换到音乐的调节音量视图旋转表冠不起作用问题 - 解决绑定死机问题,待验证 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: Caisking <3449750381@qq.com> Reviewed-by: 罗正 <1732036298@qq.com> Reviewed-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Reviewed-by: aliyun6865282430 <1624952103@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1491 --- .../nativelauncher/src/NativeLauncher.cpp | 1 + .../fd230app/nativeui/goal/src/goalmodel.cpp | 4 +-- .../player/include/MusicPlayerSourceView.h | 3 +- .../player/src/MusicPlayerSourceView.cpp | 5 ++++ .../nativeui/player/src/PlayersView.cpp | 28 +++++++++++++++++-- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 83908096c..ab8b95e77 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -562,6 +562,7 @@ namespace OHOS TakephotosModel::GetInstance()->Init(); // 拍照消息订阅 MessageModel::GetInstance().Init(); // 消息订阅监听 AssistantModel::GetInstance()->Init(); // 语音助手消息订阅 + GoalModel::GetInstance().GoalModelInitdata(); // 初始化默认首页 ScreenModels::GetInstance()->PreLoadAppimages(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp index 2d12c49bd..ed18d1343 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:09 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-05-10 11:27:16 + * @LastEditTime: 2024-12-04 16:28:23 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/GoalModel.cpp */ #include "goal/include/goalmodel.h" @@ -18,7 +18,7 @@ namespace OHOS GoalModel::GoalModel() { - GoalModelInitdata(); + // GoalModelInitdata(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GoalModel::GoalModel"); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/include/MusicPlayerSourceView.h b/code/sdk/application/wearable/fd230app/nativeui/player/include/MusicPlayerSourceView.h index 1f3523165..c69af6b38 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/include/MusicPlayerSourceView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/player/include/MusicPlayerSourceView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-08-05 15:20:03 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-10 16:29:34 + * @LastEditTime: 2024-12-04 14:35:07 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/MusicPlayerSourceView.h */ @@ -53,6 +53,7 @@ namespace OHOS UIViewGroup *CreateMusicPlayerSourceView(void); void UpdateBluetoothHeadSetViewIsVisible(void); void UpdateBluetoothHeadsetConnectLabel(void); + UIScrollView *GetMusicPlayerSourcescrollView(void); private: UILabelButton *MusicPlayerSourceViewLabelButtonInit(ButtonConfig &buttonconfig); diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerSourceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerSourceView.cpp index 78cdfa050..031cf8f42 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerSourceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerSourceView.cpp @@ -531,4 +531,9 @@ namespace OHOS } } } + + UIScrollView *MusicPlayerSourceView::GetMusicPlayerSourcescrollView(void) + { + return scrollView; + } } 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 1ed558794..3503e3393 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp @@ -867,7 +867,7 @@ namespace OHOS } } - /// @brief 设置音乐播放按钮是否可点击 + /// @brief 设置音乐播放模式按钮是否可点击 /// @param musicSourceType 音乐来源类型 false:手表音乐 true 手机音乐 /// @param phoneMusicConnectStatus 手机音乐连接状态 void PlayersView::SetMusicPlayerButtonIsTouchable(bool musicSourceType) @@ -879,7 +879,17 @@ namespace OHOS /* -------------------------------------------------------------------------- */ if (musicSourceType) // 如果切換到手机音乐,且当前在放歌,就停止音乐 { - bool value = PlayersModel::GetInstance()->get_player_state(); + // bool value = PlayersModel::GetInstance()->get_player_state(); + bool value = false; + if (PlayersModel::GetInstance()->get_avrcp_ct_or_tg_is_connected() && + PlayersModel::GetInstance()->get_a2dp_sink_playing_state()) //若ct或tg端是已连接状态且当前a2dp_sink是已播放状态 + { + value = true; + } + else + { + value = false; + } SetPlayerButtonState(value ? UICheckBox::UICheckBoxState::SELECTED:UICheckBox::UICheckBoxState::UNSELECTED); /*停止音乐*/ StopCurPlayingMusic(); @@ -1398,6 +1408,13 @@ namespace OHOS group[thisView] = musicPlayerSourceView->CreateMusicPlayerSourceView(); Add(group[thisView]); } + if (musicPlayerSourceView != nullptr ) + { + if(musicPlayerSourceView->GetMusicPlayerSourcescrollView() != nullptr) + { + musicPlayerSourceView->GetMusicPlayerSourcescrollView()->RequestFocus(); + } + } return true; } @@ -1421,6 +1438,13 @@ namespace OHOS group[thisView] = volumeSettingView; Add(group[thisView]); } + if(volumeSettingView) + { + if(volumeSettingView->GetProgress()) + { + volumeSettingView->GetProgress()->RequestFocus(); + } + } return true; } -- 2.17.1