From 5e1994a0e7e359ad22d7259c93c3fd2f8a87e792 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Fri, 17 Jan 2025 10:28:10 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3#1270,ios=20app=E4=B8=8A?= =?utf8?q?=E4=BC=A0=E9=9F=B3=E4=B9=90=E5=88=B0=E6=89=8B=E8=A1=A8=E5=90=8E?= =?utf8?q?=EF=BC=8C=E6=89=8B=E8=A1=A8=E7=AB=AF=E9=83=A8=E5=88=86=E9=9F=B3?= =?utf8?q?=E4=B9=90=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA=E4=B8=8Eapp?= =?utf8?q?=E7=AB=AF=E4=B8=8D=E4=B8=80=E8=87=B4bug(=E5=AE=89=E5=8D=93APP?= =?utf8?q?=E9=9C=80=E8=A6=81=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../player/include/PlayersCaseListAdapter.h | 3 ++- .../player/src/PlayersCaseListAdapter.cpp | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersCaseListAdapter.h b/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersCaseListAdapter.h index f9e4f1fdb..6839edc13 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersCaseListAdapter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersCaseListAdapter.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-09 16:46:56 + * @LastEditTime: 2025-01-16 18:35:24 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersCaseListAdapter.h */ @@ -32,6 +32,7 @@ namespace OHOS uint16_t GetCount() override; private: + bool GetCurrentMusicIsPlaying(void); UIView::OnClickListener *listener{nullptr}; }; } // namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersCaseListAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersCaseListAdapter.cpp index 000e34dd9..84e0b2c6a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersCaseListAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersCaseListAdapter.cpp @@ -140,6 +140,16 @@ namespace OHOS return PlayersListGroup::GetInstance()->GetCase().Size(); } + bool PlayersCaseListAdapter::GetCurrentMusicIsPlaying(void) + { + int state = PlayersModel::GetInstance()->GetPlayerState(); + if (state == PlayerStates::PLAYER_STARTED || state == PlayerStates::PLAYER_PAUSED || state == PlayerStates::PLAYER_PLAYBACK_COMPLETE) { + return true; + } else { + return false; + } + } + UIView *PlayersCaseListAdapter::GetView(UIView *inView, int16_t index) { List &playersCaseList = PlayersListGroup::GetInstance()->GetCase(); @@ -157,10 +167,10 @@ namespace OHOS node = node->next_; } /* -------------------------------------------------------------------------- */ - // std::string strSongName = node->data_.sliceId; + //歌名:3033332ee585abe5baa6e7a9bae997b42de69c80e5908ee79a84e68898e5bdb9 033.八度空间-最后的战役 std::string strSongName = PlayersModel::GetInstance()->getHexMusicNameFromMusicName(node->data_.sliceId); - std::string pureName = strSongName.substr(0, strSongName.rfind(".")); - const char *songName = pureName.c_str(); // 获取纯净歌曲名 + // std::string pureName = strSongName.substr(0, strSongName.rfind(".")); + const char *songName = strSongName.c_str(); // 获取纯净歌曲名 /* -------------------------------------------------------------------------- */ PlayerListItemView *item = nullptr; PlayerListItem listitemData; @@ -173,7 +183,7 @@ namespace OHOS { item = static_cast(inView); } - if (PlayersModel::GetInstance()->getcurrentplayingmusicname() == node->data_.sliceId && PlayersModel::GetInstance()->GetCurrentMusicIsPlaying()) + if (PlayersModel::GetInstance()->getcurrentplayingmusicname() == node->data_.sliceId && GetCurrentMusicIsPlaying()) { item->UpdateItemViewStyle(true); } -- 2.17.1