From: 罗正yun <1732036298@qq.com> Date: Thu, 18 Jan 2024 11:08:36 +0000 (+0800) Subject: 主界面音乐视图添加 X-Git-Tag: release_V1.2.70_20241020_135402~1362 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=2efce3362ed2156544e844c5ec03cfef08f3f1dc;p=mirrors%2FFD230.git 主界面音乐视图添加 --- diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp index 55a47120e..25cdaf53d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp @@ -31,6 +31,8 @@ namespace OHOS BloodView::~BloodView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodView::~BloodView()"); + RemoveAll(); DeInit(); g_pBloodView = nullptr; } @@ -184,7 +186,7 @@ namespace OHOS */ bool BloodView::InitView() { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "bool BloodView::InitView()"); if (!Initbackground()) { printf("Initbackground error!\n"); @@ -240,9 +242,10 @@ namespace OHOS } void BloodView::PreLoad(void) { - //printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); - if (InitView()) + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "void BloodView::PreLoad(void)"); + if (!viewiInitStatus) { + InitView(); viewiInitStatus = true; } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp index ab61623bd..4559f8a9c 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp @@ -35,7 +35,7 @@ void CompassControlView::ClearAll(void) bool CompassControlView::InitView(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CompassControlView InitView"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CompassControlView::InitView(void)"); compassCalibrationView = new CompassCalibrationView(); if (compassCalibrationView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CompassCalibrationView::new compassCalibrationView fail"); @@ -63,11 +63,13 @@ bool CompassControlView::InitView(void) compassView->SetVisible(true); compassCalibrationView->SetVisible(false); } + SetCoverable(true); return true; } void CompassControlView::PreLoad(void) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "void CompassControlView::PreLoad(void)"); if (!viewiInitStatus) { InitView(); viewiInitStatus = true; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp index 5fded09b8..5da5dd268 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp @@ -130,7 +130,7 @@ bool CompassView::InitCompassImage(void) } //初始化页面 bool CompassView::InitPage(void) -{ +{ if (InitCompassImage() == false) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitCompassImage fail"); ClearAll(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp index a46a64f85..65b2f0312 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp @@ -60,7 +60,6 @@ namespace OHOS */ void Digital_clockView::setJsonFilePath(const std::string &filePath) { - PRINT_DEBUG_INFO std::string defaultFile = "/user/res/clocks/default.json"; std::ifstream sourceFile(filePath, std::ios::binary); // 打开源文件 std::ofstream targetFile(defaultFile, std::ios::binary | std::ios::trunc); // 打开目标文件,使用trunc标志来覆盖目标文件 @@ -121,6 +120,7 @@ namespace OHOS } Digital_clockView::~Digital_clockView() { + RemoveAll(); DeInit(); g_pDigital_clockView = nullptr; } @@ -665,7 +665,7 @@ namespace OHOS */ bool Digital_clockView ::AddButton() { - PRINT_DEBUG_INFO + // Add Button to App if (changebutton == nullptr) { @@ -676,17 +676,16 @@ namespace OHOS changebutton->SetViewId(CHANGEBUTTON); // Set style changebutton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); changebutton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - PRINT_DEBUG_INFO + // Set additional property changebutton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); changebutton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - PRINT_DEBUG_INFO + // Add the CallBack about events UIView::OnLongPressListener *buttonLongPress = static_cast(MainPresenterSample::GetInstance()); changebutton->SetOnLongPressListener(buttonLongPress); // Add to rootView Add(changebutton); - PRINT_DEBUG_INFO return true; } /** @@ -695,7 +694,7 @@ namespace OHOS */ bool Digital_clockView ::InitView() { - PRINT_DEBUG_INFO + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bool Digital_clockView ::InitView()"); if (loadJsonData(JosnfilePath)) { std::string Dialtype = cJSON_GetObjectItem(cjson_json, "Dialtype")->valuestring; @@ -714,9 +713,7 @@ namespace OHOS AddButton(); cJSON_Delete(cjson_json); } - // Add(container_); SetCoverable(true); - PRINT_DEBUG_INFO return true; } /** @@ -811,6 +808,7 @@ namespace OHOS */ void Digital_clockView::PreLoad(void) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " void Digital_clockView::PreLoad(void)"); if (!viewiInitStatus) { InitView(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp index a642c803f..45175b63a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp @@ -31,6 +31,7 @@ namespace OHOS {COMPASS, &MainViewSample::InitCompassPage}, {BloodOxygen, &MainViewSample::InitBloodOxygenPage}, {TRAINING, &MainViewSample::InitTrainingPage}, + {PLAYER,&MainViewSample::InitMusicPlayerPage} //{APPLIST,&MainViewSample::InitApplistPage} }; @@ -318,6 +319,16 @@ namespace OHOS } return activityWeekView; } + //主界面音乐界面 + UICardPage *MainViewSample::InitMusicPlayerPage(void) + { + playersView = new PlayersView(); + if (playersView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "playersView new fail"); + return nullptr; + } + return playersView; + } UICardPage *MainViewSample::InitCompassPage(void) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h index acf92e553..b359af34d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h @@ -28,6 +28,7 @@ typedef enum { TRAINING, BloodOxygen, COMPASS, + PLAYER, //APPLIST, MAX_CARD, } CardId; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp index 3d43b9f1f..5e8c734ef 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp @@ -20,6 +20,8 @@ namespace OHOS TraingView::~TraingView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TraingView::~TraingView()"); + RemoveAll(); DeInit(); g_pTraingView = nullptr; } @@ -202,13 +204,13 @@ namespace OHOS // Add to rootView Add(image3); - + return true; } bool TraingView::InitView() { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TraingView::InitView()"); if (!InitLable()) { printf("InitLable error!\n"); @@ -270,9 +272,10 @@ namespace OHOS } void TraingView::PreLoad(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); - if (InitView()) + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TraingView::PreLoad(void)"); + if (!viewiInitStatus) { + InitView(); viewiInitStatus = true; } } diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass.bin index 2d0c5d882..766d8f8a0 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass.bin and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass.bin differ