From: Caisking <3449750381@qq.com> Date: Fri, 22 Mar 2024 12:19:45 +0000 (+0800) Subject: 增加主界面步数卡片 X-Git-Tag: release_V1.2.70_20241020_135402~1275 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=3bf186501beb779f7a168c409e3ab649621b5530;p=mirrors%2FFD230.git 增加主界面步数卡片 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp index 44ec554c9..4d8671908 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp @@ -34,6 +34,7 @@ namespace OHOS {COMPASS, &MainViewSample::InitCompassPage}, {WEATHER, &MainViewSample::InitWeatherPage}, {MUSIC_PLAYER, &MainViewSample::InitMusicPlayerPage}, + {ACTIVITY, &MainViewSample::InitActivityPage}, #if 0 {APPLIST,&MainViewSample::InitApplistPage} #endif @@ -90,6 +91,12 @@ namespace OHOS delete dropDownView; dropDownView = nullptr; } + + if (activityWeekView != nullptr) + { + delete activityWeekView; + activityWeekView = nullptr; + } /* -------------------------------------------------------------------------- */ if (messageView != nullptr) { @@ -370,16 +377,6 @@ namespace OHOS return heartRateView; } - UICardPage *MainViewSample::InitActivityPage(void) - { - activityWeekView = new ActivityWeekView(); - if (activityWeekView == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "activityWeekView new fail"); - return nullptr; - } - return activityWeekView; - } // 主界面音乐界面 UICardPage *MainViewSample::InitMusicPlayerPage(void) { @@ -451,7 +448,17 @@ namespace OHOS presenter_->SetTaskPeroid(page); } } - + // 运动界面 + UICardPage *MainViewSample::InitActivityPage(void) + { + activityWeekView = new ActivityWeekView(); + if (activityWeekView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "activityWeekView new fail"); + return nullptr; + } + return activityWeekView; + } bool MainViewSample::IsMainClockPage(void) { // mainSwipeGroup->GetCurrentPageView(1) == dropDownView || mainSwipeGroup->GetCurrentPageView(1) == messageView diff --git a/code/sdk/application/wearable/fd230app/nativeui/screensetting/include/ScreenModels.h b/code/sdk/application/wearable/fd230app/nativeui/screensetting/include/ScreenModels.h index b91515d43..0fd62399c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/screensetting/include/ScreenModels.h +++ b/code/sdk/application/wearable/fd230app/nativeui/screensetting/include/ScreenModels.h @@ -1,3 +1,11 @@ +/*** + * @Author: Caisking 3449750381@qq.com + * @Date: 2024-03-21 09:38:22 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-03-22 20:13:30 + * @FilePath: /sdk/application/wearable/fd230app/nativeui/screensetting/include/ScreenModels.h + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ /* * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. @@ -23,6 +31,7 @@ namespace OHOS COMPASS, WEATHER, MUSIC_PLAYER, + ACTIVITY, // APPLIST, MAX_CARD, } CardId;