音乐界面优化:当歌曲数量为0的时候点击播放按钮会进入到歌曲列表中,这时会提示歌曲为空要去APP同步 903/2
authorluozheng <1732036298@qq.com>
Sat, 7 Sep 2024 07:19:41 +0000 (15:19 +0800)
committerluozheng <1732036298@qq.com>
Sat, 7 Sep 2024 07:19:41 +0000 (15:19 +0800)
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp

index 00c7750..47e648a 100644 (file)
@@ -128,11 +128,11 @@ int PlayersModel::PlayerStat()
         PlayersPresenter *playersPresenter = PlayersPresenter::GetInstance();
         if (playersPresenter != nullptr) {
             playersPresenter->PlayerbackReset();
-            SetCircleProgress(100); // 100:进度100%
+            SetCircleProgress(0); // 100:进度100%
             playersPresenter->SetPlaybackProgress(circleProgress);
         } else {
             SetPlayButtonState(false);
-            SetCircleProgress(100); // 100:进度100%
+            SetCircleProgress(0); // 100:进度100%
         }
         AudioManager::GetInstance().DeactivateAudioInterrupt(interrupt);
         isActivateAudioInterrupt = false;
@@ -945,7 +945,7 @@ bool PlayersModel::GetCurrentMusicIsPlaying(void)
             }
             else
             {
-                playerProgressValue_ = 100; // 100: max progress value
+                playerProgressValue_ = 0; // 100: max progress value
             }
             PlayersModel::GetInstance()->SetCircleProgress(playerProgressValue_);
             PlayersPresenter::GetInstance()->SetPlaybackProgress(playerProgressValue_);
index dcc61f5..3d5c1cb 100644 (file)
@@ -580,6 +580,14 @@ void ButtonOnClickListener::PlayerButtonOnClick()
         return;\r
     }\r
 \r
+    if(PlayersListGroup::GetInstance()->GetCase().IsEmpty()) //若当前歌曲列表为空他跳转到音乐列表进行提示\r
+    {\r
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "current playersCaseList_ is empty!!");\r
+        playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED);\r
+        playersView->ChangeView(PlayersView::MAIN_MUSICPLAYER_VIEW,PlayersView::MUSIC_LIST_VIEW);\r
+        return;\r
+    } \r
+\r
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "play_or_pause_Button OnClick");\r
     uint8_t state = UICheckBox::UICheckBoxState::MAX_STATUS_NUM;\r
     int32_t playerState;\r