From: Caisking <3449750381@qq.com> Date: Tue, 9 Jan 2024 09:52:44 +0000 (+0800) Subject: 删除多余文件 X-Git-Url: http://git.snicker.com.cn/css/static/script.js?a=commitdiff_plain;h=8e5fb490de867969d264c0b9684f5f182fa68865;p=mirrors%2FFD230.git 删除多余文件 --- diff --git a/code/sdk/application/wearable/nativeapp/CMakeLists.txt b/code/sdk/application/wearable/nativeapp/CMakeLists.txt index 13cf89018..677cb5e81 100755 --- a/code/sdk/application/wearable/nativeapp/CMakeLists.txt +++ b/code/sdk/application/wearable/nativeapp/CMakeLists.txt @@ -96,8 +96,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistPresenter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/MainClockView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/DialUserView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/DialMalioView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodBandoffView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp diff --git a/code/sdk/application/wearable/nativeapp/nativeui/clock/include/DialMalioView.h b/code/sdk/application/wearable/nativeapp/nativeui/clock/include/DialMalioView.h deleted file mode 100755 index 138ec0fbc..000000000 --- a/code/sdk/application/wearable/nativeapp/nativeui/clock/include/DialMalioView.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: DialMalioView - * Author: - * Create: 2021-10-18 - */ -#if 0 - #ifndef DialMalio_VIEW_H - #define DialMalio_VIEW_H - - #include - #include - #include "View.h" - #include "components/ui_label.h" - #include "components/root_view.h" - #include "components/ui_view_group.h" - #include "components/ui_image_view.h" - #include "components/ui_label_button.h" - #include "components/ui_sweep_clock.h" - #include "BaseView.h" - #include "ChangeSliceListener.h" - #include "font/ui_font_bitmap.h" - #include "font/ui_font.h" - #include "graphic_config.h" - #include "HealthModel.h" - #include "ActivityModel.h" - #include "UiConfig.h" - #include "components/ui_card_page.h" - #include "animator/animator_manager.h" - #include "time.h" - #include "sys/time.h" - - namespace OHOS - { - class ClockCallback : public AnimatorCallback - { - public: - explicit ClockCallback(UISweepClock *clock) : sweepClock(clock) {} - ~ClockCallback() {} - virtual void Callback(UIView *view) - { - UNUSED(view); - struct timeval tv; - gettimeofday(&tv, NULL); - uint64_t second = tv.tv_sec; - uint64_t uSecond = tv.tv_usec; - uint64_t minute = second / 60; - uint64_t hour = minute / 60; - uint8_t realHour = static_cast(hour % 24); - uint8_t realMinute = static_cast(minute % 60); - uint16_t realMilliSecond = static_cast((second % 60) * - 1000 + - uSecond / 1000); - sweepClock->SetSweepTime12Hour(realHour, realMinute, realMilliSecond, 1); - } - - private: - UISweepClock *sweepClock{nullptr}; - }; - - class DialMalioView : public UICardPage - { - public: - DialMalioView(); - virtual ~DialMalioView(); - static DialMalioView *GetInstance(void); - bool InitView(void); - void PreLoad(void) override; - void UnLoad(void) override; - void RefreshStep(int step); - void RefreshHeartRate(int value); - void ClockAnimatorStart(void); - void ClockAnimatorStop(void); - - private: - void InitStepValue(); - bool InitLabelView(void); - bool InitCenterCircleView(void); - bool InitHandView(void); - void InitDateTime(void); - bool InitSweepClock(void); - bool LoadClockImage(Image *view, uint32_t resId); - bool LoadClockImage(UIImageView *view, uint32_t resId); - UIImageView *curFace{nullptr}; - UILabelButton *stepLabel{nullptr}; - UIButton *button1_ = nullptr; - UILabel *batteryLabel{nullptr}; - UILabel *weekLabel{nullptr}; - UILabel *heartRateLabel{nullptr}; - ClockCallback *callBack{nullptr}; - Animator *clockAnimator{nullptr}; - UISweepClock *mainSweepClock{nullptr}; - Image *secondHand{nullptr}; - Image *minuteHand{nullptr}; - Image *hourHand{nullptr}; - UIImageView *heartRate{nullptr}; - Image *hand24Hour{nullptr}; - UIImageView *weekDay{nullptr}; - UIImageView *progress{nullptr}; - Image *bigCircle{nullptr}; - Image *medCircle{nullptr}; - Image *smallCircle{nullptr}; - bool viewiInitStatus{false}; - }; - } // namespace OHOS - #endif // DialMalio_VIEW_H -#endif -#ifndef DialMalioVIEW_H -#define DialMalioVIEW_H - -#include -#include -#include "View.h" -#include "components/ui_label.h" -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_image_view.h" -#include "components/ui_label_button.h" -#include "components/ui_sweep_clock.h" -#include "BaseView.h" -#include "ChangeSliceListener.h" -#include "font/ui_font_bitmap.h" -#include "font/ui_font.h" -#include "graphic_config.h" -#include "HealthModel.h" -#include "ActivityModel.h" -#include "UiConfig.h" -#include "components/ui_card_page.h" -#include "animator/animator_manager.h" -#include "time.h" -#include "sys/time.h" -#include "graphic_config.h" -#include "components/ui_label_button.h" - -namespace OHOS -{ - class DialMalioView : public UICardPage - { - public: - DialMalioView(); - ~DialMalioView(); - void Init(); - void DeInit(); - UIView *GetView(); - void PreLoad(void) override; - void ClockAnimatorStart(void); - void ClockAnimatorStop(void); - - private: - DialMalioView(const DialMalioView &) = delete; - DialMalioView &operator=(const DialMalioView &) = delete; - DialMalioView(DialMalioView &&) = delete; - DialMalioView &operator=(DialMalioView &&) = delete; - - UIViewGroup *container_ = nullptr; - Animator *clockAnimator{nullptr}; - UIImageView *image1_ = nullptr; - UISweepClock *sweepClock1_ = nullptr; - AnimatorCallback *sweepClock1callback_ = nullptr; - Animator *sweepClock1animator_ = nullptr; - UILabelButton *labelButton1_ = nullptr; - UIButton *button1_ = nullptr; - bool viewiInitStatus{false}; - }; -} // namespace OHOS -#endif /* DialMalioVIEW_H */ \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/clock/include/DialUserView.h b/code/sdk/application/wearable/nativeapp/nativeui/clock/include/DialUserView.h deleted file mode 100755 index 967e37a86..000000000 --- a/code/sdk/application/wearable/nativeapp/nativeui/clock/include/DialUserView.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2023 CompanyNameMagicTag. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef DialUserVIEW_H -#define DialUserVIEW_H - -#include -#include -#include "View.h" -#include "components/ui_label.h" -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_image_view.h" -#include "components/ui_label_button.h" -#include "components/ui_sweep_clock.h" -#include "BaseView.h" -#include "ChangeSliceListener.h" -#include "font/ui_font_bitmap.h" -#include "font/ui_font.h" -#include "graphic_config.h" -#include "HealthModel.h" -#include "ActivityModel.h" -#include "UiConfig.h" -#include "components/ui_card_page.h" -#include "animator/animator_manager.h" -#include "time.h" -#include "sys/time.h" - -namespace OHOS -{ - class DialUserView : public UICardPage - { - public: - DialUserView(); - ~DialUserView(); - static DialUserView *GetInstance(void); - void Loadperfile(); - void Initdigit(); - void Initdata(); - void Initweek(); - void Initbattery(); - - void DeInit(); - void OnTimer(void); - void PreLoad(void) override; - void ClockAnimatorStart(void); - void ClockAnimatorStop(void); - UIView *GetView(); - - private: - void InitDateTime(void); - DialUserView(const DialUserView &) = delete; - DialUserView &operator=(const DialUserView &) = delete; - DialUserView(DialUserView &&) = delete; - DialUserView &operator=(DialUserView &&) = delete; - - UIViewGroup *container_ = nullptr; - UIImageView *background = nullptr; - UIImageView *hour1 = nullptr; - UIImageView *hour2 = nullptr; - UIImageView *colon = nullptr; - UIImageView *minute1 = nullptr; - UIImageView *minute2 = nullptr; - UILabel *dataLabel = nullptr; - UILabel *weekLabel = nullptr; - UILabel *batteryLabel = nullptr; - Animator *clockAnimator{nullptr}; - bool viewiInitStatus{false}; - }; -} // namespace OHOS -#endif /* DialUserVIEW_H */ diff --git a/code/sdk/application/wearable/nativeapp/nativeui/clock/src/DialMalioView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/clock/src/DialMalioView.cpp deleted file mode 100755 index 21c8efeaa..000000000 --- a/code/sdk/application/wearable/nativeapp/nativeui/clock/src/DialMalioView.cpp +++ /dev/null @@ -1,472 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: DialMalioView - * Author: - * Create: 2021-08-14 - */ - -#if 0 -#include "DialMalioView.h" -#include "MainPresenterSample.h" -#include "components/ui_label.h" -#include "wearable_log.h" -#include "ui_resource_image.h" -#include "common/image_cache_manager.h" -#include - -namespace OHOS -{ - static DialMalioView *g_pDialMalioView = nullptr; - - DialMalioView::DialMalioView() - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DialMalioView::DialMalioView"); - g_pDialMalioView = this; - } - - DialMalioView::~DialMalioView() - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DialMalioView::~DialMalioView"); - if (clockAnimator != nullptr) - { - clockAnimator->Stop(); - delete clockAnimator; - clockAnimator = nullptr; - } - mainSweepClock->RemoveAll(); - g_pDialMalioView = nullptr; - } - - DialMalioView *DialMalioView::GetInstance(void) - { - return g_pDialMalioView; - } - - void DialMalioView::InitStepValue() {} - - bool DialMalioView::InitLabelView(void) {} - - bool DialMalioView::InitCenterCircleView(void) {} - - bool DialMalioView::InitHandView(void) - { - secondHand = new Image(); - if (secondHand == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "secondHand new fail"); - return false; - } - if (LoadClockImage(secondHand, CLOCK_SECONDHAND) == false) - { - return false; - } - - minuteHand = new Image(); - if (minuteHand == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "minuteHand new fail"); - return false; - } - if (LoadClockImage(minuteHand, CLOCK_MINUTEHAND) == false) - { - return false; - } - hourHand = new Image(); - if (hourHand == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hourHand new fail"); - return false; - } - if (LoadClockImage(hourHand, CLOCK_HOURHAND) == false) - { - return false; - } - } - - bool DialMalioView::LoadClockImage(Image *view, uint32_t resId) - { - std::string file = CLOCK_IAMGES; - ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, file); - if (image == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LoadClockImage %x fail", resId); - return false; - } - view->SetSrc(image); - return true; - } - - bool DialMalioView::LoadClockImage(UIImageView *view, uint32_t resId) - { - std::string file = CLOCK_IAMGES; - ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, file); - if (image == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LoadClockImage %x fail", resId); - return false; - } - view->SetSrc(image); - return true; - } - - bool DialMalioView::InitSweepClock(void) - { - curFace = new UIImageView(); - if (curFace == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace new fail"); - return false; - } - curFace->SetPosition(0, 0); - - if (LoadClockImage(curFace, CLOCK_MAIN_FACE_IMAGE) == false) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace LoadClockImage CLOCK_MAIN_FACE_IMAGE fail"); - return false; - } - InitHandView(); - return true; - } - void DialMalioView::PreLoad(void) - { - if (!viewiInitStatus) - { - InitView(); - viewiInitStatus = true; - } - } - - void DialMalioView::UnLoad(void) - { - // Main clock view is commonly used page, so we do not release it's resources inner slice. - } - bool DialMalioView::InitView(void) - { - mainSweepClock = new UISweepClock(); - if (mainSweepClock == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainSweepClock new fail"); - return false; - } - if (InitSweepClock() == false) - { - return false; - } - - mainSweepClock->Add(curFace); - Add(mainSweepClock); - - mainSweepClock->SetDragParentInstead(true); - mainSweepClock->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - - // {214, 3}: position x, y {14, 223}: center x, y - mainSweepClock->SetHandImage(UISweepClock::HandType::SECOND_HAND, *secondHand, - {221, 28}, {12, 205}); - mainSweepClock->SetHandImage(UISweepClock::HandType::MINUTE_HAND, *minuteHand, - {221, 33}, {221, 87}); - mainSweepClock->SetHandImage(UISweepClock::HandType::HOUR_HAND, *hourHand, - {221, 87}, {12, 146}); - mainSweepClock->SetInitTime24Hour(0, 0, 0); - mainSweepClock->SetWorkMode(UISweepClock::WorkMode::NORMAL); - InitDateTime(); - - callBack = new ClockCallback(mainSweepClock); - if (callBack == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "callBack new fail"); - return false; - } - clockAnimator = new Animator(callBack, mainSweepClock, 0, true); - if (clockAnimator == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clockAnimator new fail"); - return false; - } - clockAnimator->Start(); - return true; - } - - void DialMalioView::RefreshStep(int step) {} - - void DialMalioView::RefreshHeartRate(int value) {} - - void DialMalioView::InitDateTime(void) - { - struct tm pTM; - time_t seconds; - time(&seconds); - localtime_r(&seconds, &pTM); - mainSweepClock->SetTime24Hour(pTM.tm_hour, pTM.tm_min, pTM.tm_sec); - } - - void DialMalioView::ClockAnimatorStart(void) - { - if (clockAnimator != nullptr) - { - clockAnimator->Start(); - } - } - - void DialMalioView::ClockAnimatorStop(void) - { - if (clockAnimator != nullptr) - { - clockAnimator->Stop(); - } - } - -} -#endif - -#include "DialMalioView.h" -#include "MainClockView.h" -#include "MainPresenterSample.h" -#include "components/ui_label.h" -#include "wearable_log.h" -#include "ui_resource_image.h" -#include "common/image_cache_manager.h" -#include - -namespace OHOS -{ - class SweepClockCallback : public AnimatorCallback - { - public: - explicit SweepClockCallback(UISweepClock *clock) : sweepClock(clock) {} - ~SweepClockCallback() {} - - virtual void Callback(UIView *view) - { - // UNUSED(view); - struct timeval tv; - gettimeofday(&tv, NULL); - uint64_t second = tv.tv_sec; - uint64_t uSecond = tv.tv_usec; - uint64_t minute = second / MIN_TO_HOUR; - uint64_t hour = minute / MIN_TO_HOUR; - uint8_t realHour = static_cast(hour % HOURLY_SYSTEM); - uint8_t realMinute = static_cast(minute % MIN_TO_HOUR); - uint16_t realMilliSecond = static_cast((second % MIN_TO_HOUR) * - SEC_TO_MILLI + - uSecond / USEC_TO_MILLI); - sweepClock->SetSweepTime12Hour(realHour, realMinute, realMilliSecond, 1); - } - - private: - static constexpr int16_t SEC_TO_MILLI = 1000; - static constexpr int16_t USEC_TO_MILLI = 1000; - static constexpr int16_t MIN_TO_HOUR = 60; - static constexpr int16_t HOURLY_SYSTEM = 24; - static constexpr int16_t INTERVAL = 30; - UISweepClock *sweepClock{nullptr}; - }; - - static DialMalioView *g_pDialMalioView = nullptr; - - DialMalioView::DialMalioView() - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DialMalioView::DialMalioView"); - SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - g_pDialMalioView = this; - } - - DialMalioView::~DialMalioView() - { - DeInit(); - delete g_pDialMalioView; - g_pDialMalioView = nullptr; - } - - void DialMalioView::Init() - { - // Other initialization code - UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::MainPresenterSample::GetInstance(); - container_ = new UIViewGroup(); - if (container_ == nullptr) - { - return; - } - container_->SetPosition(0, 0); - container_->SetWidth(Screen::GetInstance().GetWidth()); - container_->SetHeight(Screen::GetInstance().GetHeight()); - container_->SetTouchable(true); - container_->SetDraggable(true); - - RootView::GetInstance()->Add(container_); - // Add ImageView to App - if (image1_ == nullptr) - { - image1_ = new UIImageView(); - } - image1_->SetPosition(0, 0); // widget's left position and top position - image1_->Resize(466, 466); // widget's width and height - image1_->SetViewId("image1"); // Set style - - // Set additional property -#ifdef _WIN32 - char *image1imagesPath = "c:/Users/caiking/project/image_converter_tool/dogmalio.bin"; -#else - char *image1imagesPath = "/user/res/Dial/dogmalio.bin"; -#endif - image1_->SetSrc(image1imagesPath); - - // Add to rootView - container_->Add(image1_); - image1_->SetVisible(true); - - // Add SweepClock to App - if (sweepClock1_ == nullptr) - { - sweepClock1_ = new UISweepClock(); - } - sweepClock1_->SetPosition(0, 0); // widget's left position and top position - sweepClock1_->Resize(466, 466); // widget's width and height - sweepClock1_->SetViewId("sweepClock1"); // Set style - sweepClock1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - sweepClock1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property - sweepClock1_->SetWorkMode(UISweepClock::WorkMode::NORMAL); - Image *sweepClock1HourImage = new Image(); -#ifdef _WIN32 - sweepClock1HourImage->SetSrc("c:/Users/caiking/project/image_converter_tool/output/Dial/hour.bin"); -#else - sweepClock1HourImage->SetSrc("/user/res/Dial/hour.bin"); -#endif - sweepClock1_->SetHandImage(UISweepClock::HandType::HOUR_HAND, *sweepClock1HourImage, {221, 87}, {12, 146}); - Image *sweepClock1MinuteImage = new Image(); -#ifdef _WIN32 - sweepClock1MinuteImage->SetSrc("c:/Users/caiking/project/image_converter_tool/output/Dial/minute.bin"); -#else - sweepClock1MinuteImage->SetSrc("/user/res/Dial/minute.bin"); -#endif - sweepClock1_->SetHandImage(UISweepClock::HandType::MINUTE_HAND, *sweepClock1MinuteImage, {221, 33}, {12, 200}); - Image *sweepClock1SecondImage = new Image(); -#ifdef _WIN32 - sweepClock1SecondImage->SetSrc("c:/Users/caiking/project/image_converter_tool/output/Dial/second.bin"); -#else - sweepClock1SecondImage->SetSrc("/user/res/Dial/second.bin"); -#endif - sweepClock1_->SetHandImage(UISweepClock::HandType::SECOND_HAND, *sweepClock1SecondImage, {221, 28}, {12, 205}); - uint16_t sweepClock1realMilliSecond = 40 * 1000; - sweepClock1_->SetSweepTime12Hour(10, 20, sweepClock1realMilliSecond, true); - - sweepClock1callback_ = new SweepClockCallback(sweepClock1_); - sweepClock1animator_ = new Animator(sweepClock1callback_, sweepClock1_, 0, true); - sweepClock1animator_->Start(); - - // Add to rootView - container_->Add(sweepClock1_); - sweepClock1_->SetVisible(true); - - // Add LabelButtonExt to App - if (labelButton1_ == nullptr) - { - labelButton1_ = new UILabelButton(); - } - labelButton1_->SetPosition(133, 266); // widget's left position and top position - labelButton1_->Resize(200, 200); // widget's width and height - labelButton1_->SetViewId("labelButton1"); // Set style - labelButton1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - labelButton1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property - labelButton1_->SetText("11月27号\n星期一"); - labelButton1_->SetLabelPosition(2, 0); - labelButton1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); - labelButton1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - - // Add to rootView - container_->Add(labelButton1_); - labelButton1_->SetVisible(true); - - // Add Button to App - if (button1_ == nullptr) - { - button1_ = new UIButton(); - } - button1_->SetPosition(0, 0); // widget's left position and top position - button1_->Resize(466, 466); // widget's width and height - button1_->SetViewId("button1"); // Set style - button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property - button1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); - button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - - // Add the CallBack about events - UIView::OnLongPressListener *button1LongPress = static_cast(MainPresenterSample::GetInstance()); - button1_->SetOnLongPressListener(button1LongPress); - // Add to rootView - container_->Add(button1_); - button1_->SetVisible(true); - SetCoverable(true); - } - - void DialMalioView::DeInit() - { - if (clockAnimator != nullptr) - { - clockAnimator->Stop(); - delete clockAnimator; - clockAnimator = nullptr; - } - if (container_ != nullptr) - { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - if (image1_ != nullptr) - { - delete image1_; - image1_ = nullptr; - } - if (sweepClock1callback_ != nullptr) - { - delete sweepClock1callback_; - sweepClock1callback_ = nullptr; - } - if (sweepClock1animator_ != nullptr) - { - delete sweepClock1animator_; - sweepClock1animator_ = nullptr; - } - if (labelButton1_ != nullptr) - { - delete labelButton1_; - labelButton1_ = nullptr; - } - } - - UIView *DialMalioView::GetView() - { - Init(); - return container_; - } - - void DialMalioView::PreLoad(void) - { - if (!viewiInitStatus) - { - GetView(); - viewiInitStatus = true; - } - } - void DialMalioView::ClockAnimatorStart(void) - { - if (clockAnimator != nullptr) - { - clockAnimator->Start(); - } - } - - void DialMalioView::ClockAnimatorStop(void) - { - if (clockAnimator != nullptr) - { - clockAnimator->Stop(); - } - } -} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/clock/src/DialUserView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/clock/src/DialUserView.cpp deleted file mode 100755 index e533c086c..000000000 --- a/code/sdk/application/wearable/nativeapp/nativeui/clock/src/DialUserView.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 CompanyNameMagicTag. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "DialUserView.h" -#include "components/ui_label.h" -#include "wearable_log.h" -#include "ui_resource_image.h" -#include "common/image_cache_manager.h" -#include -#include -#include -namespace OHOS -{ -} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/dial/include/Digital_clockView.h b/code/sdk/application/wearable/nativeapp/nativeui/dial/include/Digital_clockView.h index e2a6ef9fa..c594dd0f6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/dial/include/Digital_clockView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/dial/include/Digital_clockView.h @@ -166,7 +166,7 @@ namespace OHOS // 将小时和分钟转换为字符串,并更新 stringtime stringtime = (hour < 10 ? "0" : "") + std::to_string(hour) + ":" + (minute < 10 ? "0" : "") + std::to_string(minute); printf("Before updating images\n"); - printf("--%s:%s--\n", imageFolderPath.c_str(), stringtime.c_str()); + //printf("--%s:%s--\n", imageFolderPath.c_str(), stringtime.c_str()); updateImage(hour1, imageFolderPath.c_str(), stringtime.substr(0, 1)); updateImage(hour2, imageFolderPath.c_str(), stringtime.substr(1, 1)); updateImage(minute1, imageFolderPath.c_str(), stringtime.substr(3, 1)); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h index 6d49c1e72..cff99d5b3 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h @@ -22,8 +22,6 @@ #include "ActivityWeekView.h" #include "CompassControlView.h" #include "MainClockView.h" -#include "DialUserView.h" -#include "DialMalioView.h" #include "PlayersView.h" #include "MainPresenterSample.h" #include "HeartRateView.h" @@ -70,8 +68,6 @@ private: UICardPage *messageView{nullptr}; UILabel *messageLable{nullptr}; MainClockView *mainClockView{nullptr}; - DialUserView *dialUserView{nullptr}; - DialMalioView *dialmalioview{nullptr}; ActivityWeekView *activityWeekView{nullptr}; PlayersView *playersView{nullptr}; CompassControlView *compassControlView{nullptr}; 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 e7c06b8c1..8b243a059 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp @@ -52,10 +52,10 @@ MainViewSample::~MainViewSample() mainSwipeGroup = nullptr; } - // if (mainClockView != nullptr) { - // delete mainClockView; - // mainClockView = nullptr; - // } + if (mainClockView != nullptr) { + delete mainClockView; + mainClockView = nullptr; + } if (activityWeekView != nullptr) { delete activityWeekView; @@ -132,8 +132,8 @@ void MainViewSample::OnStart() mainSwipeGroup->SetLoopState(true); mainSwipeGroup->EnableScreenCap(true); mainSwipeGroup->RegisterSwipeCallback(callback); - //mainSwipeGroup->SetHorCurrentPage(mainClockView->GetViewIndex()); - mainSwipeGroup->SetHorCurrentPage(dialmalioview->GetViewIndex()); + mainSwipeGroup->SetHorCurrentPage(mainClockView->GetViewIndex()); + SetContainerView(mainSwipeGroup); } @@ -246,30 +246,13 @@ void MainViewSample::OnStop() UICardPage *MainViewSample::InitWatchFacePage(void) { - #if 0 - dialUserView = new DialUserView(); - //dialUserView->PreLoad(); - if ( dialUserView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialUserView new fail"); - return nullptr; - } - printf("creat dial succes!!\n"); - return dialUserView; - #endif - #if 1 mainClockView = new MainClockView(); if (mainClockView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail"); return nullptr; } return mainClockView; - #endif - - #if 0 - dialmalioview = new DialMalioView(); - return dialmalioview; - #endif } UICardPage *MainViewSample::InitHeartRatePage(void) @@ -335,14 +318,11 @@ void MainViewSample::AnimatorStart(int pageIndex) if (heartRateView != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(HEART_RATE)) { heartRateView->HeartbeatImageAnimatorStart(); } - // if ((mainClockView != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(WATCH_FACE)) && - // mainSwipeGroup->GetCurrentPageId(UISwipeView::VERTICAL) == 1) { - // mainClockView->ClockAnimatorStart(); - // } - if ((dialmalioview != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(WATCH_FACE)) && + if ((mainClockView != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(WATCH_FACE)) && mainSwipeGroup->GetCurrentPageId(UISwipeView::VERTICAL) == 1) { - dialmalioview->ClockAnimatorStart(); + mainClockView->ClockAnimatorStart(); } + } void MainViewSample::AnimatorStop(void) @@ -353,9 +333,6 @@ void MainViewSample::AnimatorStop(void) if (mainClockView != nullptr) { mainClockView->ClockAnimatorStop(); } - // if (dialmalioview != nullptr) { - // dialmalioview->ClockAnimatorStop(); - // } } bool MainViewSample::IsMainView(void)