From: 罗正yun <1732036298@qq.com> Date: Tue, 9 Jan 2024 10:23:02 +0000 (+0800) Subject: 优化修改指南针视图的图片读取,将多张bin图片合成一张图片(compass.bin),用ImageCacheManager类来管理,避免图片的多次读取。 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=cbf645b3ad01877173cf8f8cfde34da6c811c37a;p=mirrors%2FFD230.git 优化修改指南针视图的图片读取,将多张bin图片合成一张图片(compass.bin),用ImageCacheManager类来管理,避免图片的多次读取。 --- diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h index 458dae173..cc524cead 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h @@ -224,20 +224,6 @@ namespace OHOS static constexpr const char *PNG_RECORD_PLAY_DELETE_IMAGE = APP_RES_PATH "/Record/RECORD_PLAY_DELETE.bin"; // 删除 static constexpr const char *PNG_RECORD_PLAY_VOLUME_IMAGE = APP_RES_PATH "/Record/RECORD_PLAY_VOLUME.bin"; // 音量 static constexpr const char *PNG_RECORD_DELETE_BACKGROUND_IMAGE = APP_RES_PATH "/Record/RECORD_DELETE_BACKGROUND.bin"; // 删除录音的背景图 - // 指南针 - static constexpr const char *PNG_COMPASS_BACKGROUND_IMAGE = APP_RES_PATH "/compass/compass0.bin"; // 指南针的背景图片 - static constexpr const char *PNG_COMPASS_PLACE_MARKER_BUTTON_IMAGE = APP_RES_PATH "/compass/compass1.bin"; // 指南针放置标记点按钮图片 - static constexpr const char *PNG_COMPASS_TRIANGULATION_IMAGE = APP_RES_PATH "/compass/compass2.bin"; // 指南针三角形图片 - static constexpr const char *PNG_COMPASS_PLACE_MAKER_BACKGROUND_IMAGE = APP_RES_PATH "/compass/PLACE_MAKER_BACKGROUND.bin"; // 指南针放置标记点背景图片 - static constexpr const char *PNG_COMPASS_MAKER_POINT_BACKGROUND_IMAGE = APP_RES_PATH "/compass/MAKER_POINT_BACKGROUND.bin"; // 指南针标记点介绍背景图片 - static constexpr const char *PNG_COMPASS_START_PATH_RECORD_IMAGE = APP_RES_PATH "/compass/COMPASS_START_PATH_RECORD.bin"; // 指南针开始路径记录图片 - static constexpr const char *PNG_COMPASS_END_PATH_RECORD_IMAGE = APP_RES_PATH "/compass/COMPASS_END_PATH_RECORD.bin"; // 指南针结束路径记录图片 - static constexpr const char *PNG_COMPASS_PATH_BACKTRACKING_IMAGE = APP_RES_PATH "/compass/COMPASS_PATH_BACKTRACKING.bin"; // 指南针路径回溯按钮图片 - static constexpr const char *PNG_COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE = APP_RES_PATH "/compass/COMPASS_RESET_PLACE_MAKER_BACKGROUND.bin"; // 指南针:重置标记点背景图片 - static constexpr const char *PNG_COMPASS_PATH_BACKTRACKING_DIRECT_IMAGE = APP_RES_PATH "/compass/COMPASS_PATH_BACKTRACKING_DIRECT.bin"; // 指南针:路径回溯中的方向箭头图片 - static constexpr const char *PNG_COMPASS_END_BACK_TRACKING_EARLY_IMAGE = APP_RES_PATH "/compass/COMPASS_END_BACK_TRACKING_EARLY.bin"; // 指南针提前结束路径回溯 - static constexpr const char *PNG_COMPASS_END_BACK_TRACKING_IMAGE = APP_RES_PATH "/compass/COMPASS_END_BACK_TRACKING.bin"; // 指南针结束路径回溯 - static constexpr const char *PNG_COMPASS_GPS_LOSS_IMAGE = APP_RES_PATH "/compass/COMPASS_GPS_LOSS.bin"; // 指南针GPS丢失背景图片 // 睡眠记录 static constexpr const char *PNG_SLEEP_ROOM_IMAGE = APP_RES_PATH "/SleepTime/room.bin"; static constexpr const char *PNG_SLEEP_NOTE_IMAGE = APP_RES_PATH "/SleepTime/Ellipse 185.bin"; diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/ui_resource_image.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/ui_resource_image.h index f79de41b4..fd0516026 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/ui_resource_image.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/ui_resource_image.h @@ -67,9 +67,21 @@ namespace OHOS static const int DROPDOWN_DROPDOWN_SETTING_B = 0x40000b; static const int DROPDOWN_DROPDOWN_BATTERY = 0x40000c; static const int DROPDOWN_DROPDOWN_BRI_SCREEN_B = 0x40000d; - static const int COMPASS_ROTATE_CENTER_IMAGE = 0x500001; - static const int COMPASS_CORRESPONDENCE_DEGREE = 0x500002; - static const int COMPASS_COMPASS = 0x500003; + /* -------------------------------------------------------------------------- */ + static const int COMPASS_COMPASS0 = 0x500001; // 指南针的背景图片 + static const int COMPASS_COMPASS1 = 0x500002; // 指南针放置标记点按钮图片 + static const int COMPASS_COMPASS2 = 0x500003; // 指南针三角形图片 + static const int COMPASS_END_BACK_TRACKING = 0x500004; // 指南针结束路径回溯 + static const int COMPASS_END_BACK_TRACKING_EARLY = 0x500005; // 指南针提前结束路径回溯 + static const int COMPASS_END_PATH_RECORD = 0x500006; // 指南针结束路径记录图片 + static const int COMPASS_GPS_LOSS = 0x500007; // 指南针GPS丢失背景图片 + static const int COMPASS_MAKER_POINT_BACKGROUND = 0x500008; // 指南针标记点介绍背景图片 + static const int COMPASS_PATH_BACKTRACKING = 0x500009; // 指南针路径回溯按钮图片 + static const int COMPASS_PATH_BACKTRACKING_DIRECT = 0x50000a; // 指南针:路径回溯中的方向箭头图片 + static const int COMPASS_PLACE_MAKER_BACKGROUND = 0x50000b; // 指南针放置标记点背景图片 + static const int COMPASS_RESET_PLACE_MAKER_BACKGROUND = 0x50000c; // 指南针:重置标记点背景图片 + static const int COMPASS_START_PATH_RECORD = 0x50000d; // 指南针开始路径记录图片 + /* -------------------------------------------------------------------------- */ } #endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingCompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingCompassView.h index 94dd194e7..396fc85e1 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingCompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingCompassView.h @@ -7,7 +7,7 @@ #include "components/ui_view_group.h" #include "components/ui_scroll_view.h" #include "components/ui_image_view.h" -#include "components/ui_label_button_ext.h" +#include "components/ui_label_button.h" namespace OHOS { static const char *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1_VIEWID = "COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1"; // 结束路径回溯 @@ -34,9 +34,8 @@ namespace OHOS UIViewGroup *container_ = nullptr; UIScrollView *scrollView1_ = nullptr; UIImageView *COMPASS_END_BACK_TRACKING_EARLY_IMAGE = nullptr; - UIImageView *image = nullptr; - UILabelButtonExt *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1 = nullptr; - UILabelButtonExt *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2 = nullptr; + UILabelButton *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1 = nullptr; + UILabelButton *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2 = nullptr; UIView::OnClickListener *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1_CLICK{nullptr}; UIView::OnClickListener *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2_CLICK{nullptr}; }; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingEarlyCompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingEarlyCompassView.h index a67f05d8d..29e112822 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingEarlyCompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndBackTrackingEarlyCompassView.h @@ -7,7 +7,7 @@ #include "components/ui_view_group.h" #include "components/ui_scroll_view.h" #include "components/ui_image_view.h" -#include "components/ui_label_button_ext.h" +#include "components/ui_label_button.h" namespace OHOS { static const char *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON_VIEWID = "COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON"; // 提前结束路径回溯 @@ -32,9 +32,8 @@ namespace OHOS private: UIViewGroup *container_ = nullptr; UIScrollView *scrollView1_ = nullptr; - UIImageView *image4_ = nullptr; UIImageView *COMPASS_END_BACK_TRACKING_EARLY_IMAGE = nullptr; - UILabelButtonExt *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON = nullptr; + UILabelButton *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON = nullptr; UIView::OnClickListener *COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON_CLICK{nullptr}; }; } // namespace OHOS diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndPathRecordCompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndPathRecordCompassView.h index f37b97274..e85fbdca6 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndPathRecordCompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/EndPathRecordCompassView.h @@ -34,7 +34,6 @@ namespace OHOS UIViewGroup *container_ = nullptr; UIScrollView *scrollView = nullptr; UIImageView *COMPASS_END_PATH_RECORD_IMAGE = nullptr; - UIImageView *image = nullptr; UIButton *END_PATH_RECORD_BUTTON1 = nullptr; // 结束路径记录:结束按钮 UIButton *END_PATH_RECORD_BUTTON2 = nullptr; // 结束路径记录:暂不按钮 UIView::OnClickListener *END_PATH_RECORD_BUTTON1_CLICK{nullptr}; // 结束路径记录:结束按钮点击回调 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathBackTrackingCompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathBackTrackingCompassView.h index 01245c161..8226d307a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathBackTrackingCompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathBackTrackingCompassView.h @@ -7,7 +7,7 @@ #include "components/ui_view_group.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" -#include "components/ui_label_button_ext.h" +#include "components/ui_label_button.h" namespace OHOS { static const char *PATH_BACKTRACKING_LABELBUTTON1_VIEWID = "labelButton1"; //开始回溯 @@ -35,8 +35,8 @@ namespace OHOS UIScrollView *scrollView = nullptr; UILabel *label1_ = nullptr; UILabel *label2_ = nullptr; - UILabelButtonExt *labelButton1 = nullptr; - UILabelButtonExt *labelButton2 = nullptr; + UILabelButton *labelButton1 = nullptr; + UILabelButton *labelButton2 = nullptr; UIView::OnClickListener *labelButton1Click{nullptr}; UIView::OnClickListener *labelButton2Click{nullptr}; }; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathRetracingCompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathRetracingCompassView.h index 7680147bd..57b7fe56b 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathRetracingCompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/PathRetracingCompassView.h @@ -7,7 +7,7 @@ #include "components/ui_scroll_view.h" #include "components/ui_label.h" #include "components/ui_image_view.h" -#include "components/ui_label_button_ext.h" +#include "components/ui_label_button.h" namespace OHOS { static const char *PATH_RETRACING_LABELBUTTON_VIEWID = "PATH_RETRACING_LABELBUTTON"; //结束路径回溯按钮ID @@ -35,7 +35,7 @@ namespace OHOS UILabel *label1_ = nullptr; UIImageView *image2_ = nullptr; UIImageView *image1_ = nullptr; - UILabelButtonExt *PATH_RETRACING_LABELBUTTON = nullptr; + UILabelButton *PATH_RETRACING_LABELBUTTON = nullptr; UIView::OnClickListener *PATH_RETRACING_LABELBUTTON_CLICK{nullptr}; }; } // namespace OHOS diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/ResetPlaceMakerCompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/ResetPlaceMakerCompassView.h index d50573f04..1d7cea60a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/ResetPlaceMakerCompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/ResetPlaceMakerCompassView.h @@ -33,7 +33,6 @@ namespace OHOS UIViewGroup *container_ = nullptr; UIScrollView *scrollView = nullptr; UIImageView *COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE = nullptr; - UIImageView *image = nullptr; UIButton *RESET_PLACE_MAKER_BUTTON1 = nullptr; UIButton *RESET_PLACE_MAKER_BUTTON2 = nullptr; UIView::OnClickListener *RESET_PLACE_MAKER_BUTTON1Click{nullptr}; 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 03add36c3..3484f1f4f 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp @@ -132,56 +132,22 @@ bool CompassView::LoadCompassImage(UIImageView *view, uint32_t resId) //初始化指南针图片 bool CompassView::InitCompassImage(void) { - /* + ImageInfo* image; backGround = new UIImageView(); if (backGround == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], backGround new fail", __LINE__); return false; } - backGround->SetPosition(0, 0); - - if (LoadCompassImage(backGround, COMPASS_COMPASS) == false) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], triangulation load fail", __LINE__); - return false; - } - - rotateShaft = new UIImageView(); - if (rotateShaft == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], rotateShaft new fail", __LINE__); - return false; - } - rotateShaft->SetPosition(POINT_CENTER_IMAGE_X, POINT_CENTER_IMAGE_Y); - if (LoadCompassImage(rotateShaft, COMPASS_ROTATE_CENTER_IMAGE) == false) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], rotateShaft load fail", __LINE__); - return false; - } - - triangulation = new UIImageView(); - if (triangulation == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], triangulation new fail", __LINE__); + backGround->SetPosition(0, 0,466,466); + if (LoadCompassImage(backGround, COMPASS_COMPASS0) == false) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], backGround load fail", __LINE__); return false; } - triangulation->SetPosition(TRIANGULATION_X, TRIANGULATION_Y); - if (LoadCompassImage(triangulation, COMPASS_CORRESPONDENCE_DEGREE) == false) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "triangulation load fail"); - return false; - } - return true; - */ - backGround = new UIImageView(); - if (backGround == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], backGround new fail", __LINE__); - return false; - } - backGround->SetPosition(0, 0); - backGround->Resize(466, 466); - backGround->SetViewId("backGround"); - backGround->SetSrc(PNG_COMPASS_BACKGROUND_IMAGE); - backGround->SetVisible(true); /***********************************************************************************************************/ - // Add Button to App + PlaceMarkerButton = new UIButton(); if (PlaceMarkerButton == nullptr) { - PlaceMarkerButton = new UIButton(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], PlaceMarkerButton new fail", __LINE__); + return false; } if(EndPathRecordFlag == false) { @@ -190,15 +156,18 @@ bool CompassView::InitCompassImage(void) else { PlaceMarkerButton->SetPosition(148, 282); + PathBackTrackingButton = new UIButton(); if (PathBackTrackingButton == nullptr) { - PathBackTrackingButton = new UIButton(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], PathBackTrackingButton new fail", __LINE__); + return false; } PathBackTrackingButton->SetPosition(248, 282); PathBackTrackingButton->Resize(70, 70); PathBackTrackingButton->SetViewId(PATH_BACKTRACKING_BUTTON_VIEWID); PathBackTrackingButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xfffafafa); PathBackTrackingButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - PathBackTrackingButton->SetImageSrc(PNG_COMPASS_PATH_BACKTRACKING_IMAGE, nullptr); + image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_PATH_BACKTRACKING, COMPASS_IAMGES); + PathBackTrackingButton->SetImageSrc(image, nullptr); PathBackTrackingButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); PathBackTrackingButton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); PathBackTrackingButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); @@ -211,7 +180,8 @@ bool CompassView::InitCompassImage(void) PlaceMarkerButton->SetViewId(PLACE_MARKER_BUTTON_VIEWID); PlaceMarkerButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); PlaceMarkerButton->SetStyle(STYLE_BORDER_RADIUS, 0); - PlaceMarkerButton->SetImageSrc(PNG_COMPASS_PLACE_MARKER_BUTTON_IMAGE, nullptr); + image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_COMPASS1, COMPASS_IAMGES); + PlaceMarkerButton->SetImageSrc(image, nullptr); PlaceMarkerButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); PlaceMarkerButton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); PlaceMarkerButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); @@ -229,7 +199,10 @@ bool CompassView::InitCompassImage(void) triangulation->SetPosition(221, 20); triangulation->Resize(24, 20); triangulation->SetViewId("triangulation"); - triangulation->SetSrc(PNG_COMPASS_TRIANGULATION_IMAGE); + if (LoadCompassImage(triangulation, COMPASS_COMPASS2) == false) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], triangulation load fail", __LINE__); + return false; + } triangulation->SetVisible(true); return true; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingCompassView.cpp index e3a4b4be8..1b3692cc0 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingCompassView.cpp @@ -1,7 +1,8 @@ #include "EndBackTrackingCompassView.h" #include "EndBackTrackingCompassPresenter.h" #include "UiConfig.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -42,6 +43,9 @@ namespace OHOS scrollView1_->SetPosition(0, 0); scrollView1_->Resize(466, 466); scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView1_->SetScrollBlankSize(20); + scrollView1_->SetReboundSize(50); + scrollView1_->SetDirection(1); container_->Add(scrollView1_); scrollView1_->SetVisible(true); // Add ImageView to App @@ -51,14 +55,15 @@ namespace OHOS } COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetPosition(0, 0); COMPASS_END_BACK_TRACKING_EARLY_IMAGE->Resize(466, 466); - COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetSrc(PNG_COMPASS_END_BACK_TRACKING_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_END_BACK_TRACKING, COMPASS_IAMGES); + COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetSrc(image); // Add to scrollView1 scrollView1_->Add(COMPASS_END_BACK_TRACKING_EARLY_IMAGE); COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetVisible(true); // Add LabelButtonExt to App if (COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1 == nullptr) { - COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1 = new UILabelButtonExt(); + COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1 = new UILabelButton(); } COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1->SetPosition(118, 378); COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON1->Resize(230, 80); @@ -81,7 +86,7 @@ namespace OHOS // Add LabelButtonExt to App if (COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2 == nullptr) { - COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2 = new UILabelButtonExt(); + COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2 = new UILabelButton(); } COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2->SetPosition(118, 484); COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2->Resize(230, 80); @@ -99,15 +104,6 @@ namespace OHOS // Add to scrollView1 scrollView1_->Add(COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2); COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON2->SetVisible(true); - // Add ImageView to App - if (image == nullptr) - { - image = new UIImageView(); - } - image->SetPosition(183, 493); - image->Resize(100, 100); - scrollView1_->Add(image); - image->SetVisible(true); } void EndBackTrackingCompassView::DeInitView() @@ -123,11 +119,6 @@ namespace OHOS delete scrollView1_; scrollView1_ = nullptr; } - if (image != nullptr) - { - delete image; - image = nullptr; - } if (COMPASS_END_BACK_TRACKING_EARLY_IMAGE != nullptr) { delete COMPASS_END_BACK_TRACKING_EARLY_IMAGE; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingEarlyCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingEarlyCompassView.cpp index f2bfeaa21..bfe8e4d5c 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingEarlyCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndBackTrackingEarlyCompassView.cpp @@ -1,7 +1,8 @@ #include "EndBackTrackingEarlyCompassView.h" #include "EndBackTrackingEarlyCompassPresenter.h" #include "UiConfig.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -43,6 +44,9 @@ namespace OHOS scrollView1_->Resize(466, 466); scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); container_->Add(scrollView1_); + scrollView1_->SetScrollBlankSize(20); + scrollView1_->SetReboundSize(50); + scrollView1_->SetDirection(1); scrollView1_->SetVisible(true); // Add ImageView to App if (COMPASS_END_BACK_TRACKING_EARLY_IMAGE == nullptr) @@ -51,14 +55,15 @@ namespace OHOS } COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetPosition(0, 0); COMPASS_END_BACK_TRACKING_EARLY_IMAGE->Resize(466, 466); - COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetSrc(PNG_COMPASS_END_BACK_TRACKING_EARLY_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_END_BACK_TRACKING_EARLY, COMPASS_IAMGES); + COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetSrc(image); // Add to scrollView1 scrollView1_->Add(COMPASS_END_BACK_TRACKING_EARLY_IMAGE); COMPASS_END_BACK_TRACKING_EARLY_IMAGE->SetVisible(true); // Add LabelButtonExt to App if (COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON == nullptr) { - COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON = new UILabelButtonExt(); + COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON = new UILabelButton(); } COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON->SetPosition(118, 378); COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON->Resize(230, 80); @@ -78,15 +83,6 @@ namespace OHOS scrollView1_->Add(COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON); COMPASS_END_BACK_TRACKING_EARLY_LABELBUTTON->SetVisible(true); - // Add ImageView to App - if (image4_ == nullptr) - { - image4_ = new UIImageView(); - } - image4_->SetPosition(183, 414); - image4_->Resize(100, 100); - scrollView1_->Add(image4_); - image4_->SetVisible(true); } void EndBackTrackingEarlyCompassView::DeInitView() @@ -102,11 +98,6 @@ namespace OHOS delete scrollView1_; scrollView1_ = nullptr; } - if (image4_ != nullptr) - { - delete image4_; - image4_ = nullptr; - } if (COMPASS_END_BACK_TRACKING_EARLY_IMAGE != nullptr) { delete COMPASS_END_BACK_TRACKING_EARLY_IMAGE; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndPathRecordCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndPathRecordCompassView.cpp index b138ffd53..d8eed52b5 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndPathRecordCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/EndPathRecordCompassView.cpp @@ -4,7 +4,8 @@ #include "common/image_cache_manager.h" #include "UiConfig.h" #include "ui_resource_image.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -46,6 +47,9 @@ namespace OHOS scrollView->Resize(466, 466); scrollView->SetViewId("scrollView"); scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView->SetScrollBlankSize(20); + scrollView->SetReboundSize(50); + scrollView->SetDirection(1); container_->Add(scrollView); scrollView->SetVisible(true); // Add ImageView to App @@ -55,7 +59,8 @@ namespace OHOS } COMPASS_END_PATH_RECORD_IMAGE->SetPosition(0, 0); COMPASS_END_PATH_RECORD_IMAGE->Resize(466, 466); - COMPASS_END_PATH_RECORD_IMAGE->SetSrc(PNG_COMPASS_END_PATH_RECORD_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_END_PATH_RECORD, COMPASS_IAMGES); + COMPASS_END_PATH_RECORD_IMAGE->SetSrc(image); scrollView->Add(COMPASS_END_PATH_RECORD_IMAGE); COMPASS_END_PATH_RECORD_IMAGE->SetVisible(true); @@ -72,7 +77,7 @@ namespace OHOS END_PATH_RECORD_BUTTON1->SetStyle(STYLE_BORDER_RADIUS, 100); // Set additional property END_PATH_RECORD_BUTTON1->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); - END_PATH_RECORD_BUTTON1->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); + END_PATH_RECORD_BUTTON1->SetStyleForState(STYLE_BACKGROUND_OPA, 0xff0b1928, UIButton::PRESSED); END_PATH_RECORD_BUTTON1->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); END_PATH_RECORD_BUTTON1->SetStyleForState(STYLE_BORDER_RADIUS, 100, UIButton::PRESSED); // Add the CallBack about events @@ -107,16 +112,6 @@ namespace OHOS scrollView->Add(END_PATH_RECORD_BUTTON2); END_PATH_RECORD_BUTTON2->SetVisible(true); - // Add ImageView to App - if (image == nullptr) - { - image = new UIImageView(); - } - image->SetPosition(183, 475); - image->Resize(100, 100); - image->SetViewId("image"); - scrollView->Add(image); - image->SetVisible(true); } void EndPathRecordCompassView::DeInitView() @@ -137,11 +132,6 @@ namespace OHOS delete COMPASS_END_PATH_RECORD_IMAGE; COMPASS_END_PATH_RECORD_IMAGE = nullptr; } - if (image != nullptr) - { - delete image; - image = nullptr; - } if (END_PATH_RECORD_BUTTON1 != nullptr) { delete END_PATH_RECORD_BUTTON1; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/GPSLossCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/GPSLossCompassView.cpp index b97027d72..573a18395 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/GPSLossCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/GPSLossCompassView.cpp @@ -1,7 +1,8 @@ #include "GPSLossCompassView.h" #include "GPSLossCompassPresenter.h" #include "UiConfig.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -49,7 +50,8 @@ namespace OHOS } COMPASS_GPS_LOSS_IMAGE->SetPosition(0, 0); COMPASS_GPS_LOSS_IMAGE->Resize(466, 466); - COMPASS_GPS_LOSS_IMAGE->SetSrc(PNG_COMPASS_GPS_LOSS_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_GPS_LOSS, COMPASS_IAMGES); + COMPASS_GPS_LOSS_IMAGE->SetSrc(image); // Add to scrollView1 scrollView1_->Add(COMPASS_GPS_LOSS_IMAGE); COMPASS_GPS_LOSS_IMAGE->SetVisible(true); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/MakerPointCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/MakerPointCompassView.cpp index 108814281..d6359c119 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/MakerPointCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/MakerPointCompassView.cpp @@ -1,7 +1,8 @@ #include "MakerPointCompassView.h" #include "MakerPointCompassPresenter.h" #include "UiConfig.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -39,8 +40,9 @@ namespace OHOS COMPASS_MAKER_POINT_BACKGROUND_IMAGE = new UIImageView(); } COMPASS_MAKER_POINT_BACKGROUND_IMAGE->SetPosition(0, 0); - COMPASS_MAKER_POINT_BACKGROUND_IMAGE->Resize(466, 466); - COMPASS_MAKER_POINT_BACKGROUND_IMAGE->SetSrc(PNG_COMPASS_MAKER_POINT_BACKGROUND_IMAGE); + COMPASS_MAKER_POINT_BACKGROUND_IMAGE->Resize(466, 466); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_MAKER_POINT_BACKGROUND, COMPASS_IAMGES); + COMPASS_MAKER_POINT_BACKGROUND_IMAGE->SetSrc(image); container_->Add(COMPASS_MAKER_POINT_BACKGROUND_IMAGE); COMPASS_MAKER_POINT_BACKGROUND_IMAGE->SetVisible(true); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathBackTrackingCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathBackTrackingCompassView.cpp index 3f5cce1dd..a736021cf 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathBackTrackingCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathBackTrackingCompassView.cpp @@ -43,7 +43,6 @@ namespace OHOS } scrollView->SetPosition(0, 0); scrollView->Resize(466, 466); - scrollView->SetViewId("scrollView"); scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); container_->Add(scrollView); scrollView->SetVisible(true); @@ -55,7 +54,6 @@ namespace OHOS } label1_->SetPosition(173, 52); label1_->Resize(120, 35); - label1_->SetViewId("label1"); label1_->SetStyle(STYLE_TEXT_FONT, 30); label1_->SetStyle(STYLE_LINE_HEIGHT, 35); @@ -77,7 +75,6 @@ namespace OHOS } label2_->SetPosition(33, 100); label2_->Resize(200, 60); - label2_->SetViewId("label2"); label2_->SetStyle(STYLE_TEXT_FONT, 30); label2_->SetStyle(STYLE_LINE_HEIGHT, 35); @@ -98,7 +95,7 @@ namespace OHOS // Add LabelButtonExt to App if (labelButton1 == nullptr) { - labelButton1 = new UILabelButtonExt(); + labelButton1 = new UILabelButton(); } labelButton1->SetPosition(118, 226); labelButton1->Resize(230, 80); @@ -122,7 +119,7 @@ namespace OHOS // Add LabelButtonExt to App if (labelButton2 == nullptr) { - labelButton2 = new UILabelButtonExt(); + labelButton2 = new UILabelButton(); } labelButton2->SetPosition(118, 333); labelButton2->Resize(230, 80); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathRetracingCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathRetracingCompassView.cpp index 7ceb3fc0c..35703514d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathRetracingCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PathRetracingCompassView.cpp @@ -1,7 +1,8 @@ #include "PathRetracingCompassView.h" #include "PathRetracingCompassPresenter.h" #include "UiConfig.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -73,8 +74,8 @@ namespace OHOS } image2_->SetPosition(315, 227); image2_->Resize(47, 58); - image2_->SetViewId("image2"); - image2_->SetSrc(PNG_COMPASS_PLACE_MARKER_BUTTON_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_COMPASS1, COMPASS_IAMGES); + image2_->SetSrc(image); // Add to scrollView1 scrollView1_->Add(image2_); @@ -87,8 +88,8 @@ namespace OHOS } image1_->SetPosition(110, 267); image1_->Resize(40, 46); - image1_->SetViewId("image1"); - image1_->SetSrc(PNG_COMPASS_PATH_BACKTRACKING_DIRECT_IMAGE); + image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_PATH_BACKTRACKING_DIRECT, COMPASS_IAMGES); + image1_->SetSrc(image); // Add to scrollView1 scrollView1_->Add(image1_); @@ -97,7 +98,7 @@ namespace OHOS // Add LabelButtonExt to App if (PATH_RETRACING_LABELBUTTON == nullptr) { - PATH_RETRACING_LABELBUTTON = new UILabelButtonExt(); + PATH_RETRACING_LABELBUTTON = new UILabelButton(); } PATH_RETRACING_LABELBUTTON->SetPosition(118, 345); PATH_RETRACING_LABELBUTTON->Resize(230, 80); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PlaceMakerCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PlaceMakerCompassView.cpp index c86470b15..4b6b4ec6c 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PlaceMakerCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/PlaceMakerCompassView.cpp @@ -1,7 +1,8 @@ #include "PlaceMakerCompassView.h" #include "PlaceMakerCompassPresenter.h" #include "UiConfig.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -47,7 +48,8 @@ namespace OHOS } PLACE_MAKER_BACKGROUND_IMAGE->SetPosition(0, 0); PLACE_MAKER_BACKGROUND_IMAGE->Resize(466, 466); - PLACE_MAKER_BACKGROUND_IMAGE->SetSrc(PNG_COMPASS_PLACE_MAKER_BACKGROUND_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_PLACE_MAKER_BACKGROUND, COMPASS_IAMGES); + PLACE_MAKER_BACKGROUND_IMAGE->SetSrc(image); container_->Add(PLACE_MAKER_BACKGROUND_IMAGE); PLACE_MAKER_BACKGROUND_IMAGE->SetVisible(true); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/ResetPlaceMakerCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/ResetPlaceMakerCompassView.cpp index 69b60ed4e..a791ce841 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/ResetPlaceMakerCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/ResetPlaceMakerCompassView.cpp @@ -1,7 +1,8 @@ #include "ResetPlaceMakerCompassView.h" #include "ResetPlaceMakerCompassPresenter.h" #include "UiConfig.h" - +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" namespace OHOS { @@ -43,6 +44,9 @@ namespace OHOS scrollView->Resize(466, 466); scrollView->SetViewId("scrollView"); scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView->SetScrollBlankSize(20); + scrollView->SetReboundSize(50); + scrollView->SetDirection(1); container_->Add(scrollView); scrollView->SetVisible(true); @@ -54,7 +58,8 @@ namespace OHOS COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE->SetPosition(0, 0); COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE->Resize(466, 466); COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE->SetViewId("COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE"); - COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE->SetSrc(PNG_COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_RESET_PLACE_MAKER_BACKGROUND, COMPASS_IAMGES); + COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE->SetSrc(image); // Add to scrollView1 scrollView->Add(COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE); COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE->SetVisible(true); @@ -71,8 +76,7 @@ namespace OHOS RESET_PLACE_MAKER_BUTTON1->SetStyle(STYLE_BACKGROUND_OPA, 0x00); // Set additional property RESET_PLACE_MAKER_BUTTON1->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffdfdfd, UIButton::PRESSED); - RESET_PLACE_MAKER_BUTTON1->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - RESET_PLACE_MAKER_BUTTON1->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + RESET_PLACE_MAKER_BUTTON1->SetStyleForState(STYLE_BACKGROUND_OPA, 0xff0b1928, UIButton::PRESSED); // Add the CallBack about events RESET_PLACE_MAKER_BUTTON1Click = static_cast(ResetPlaceMakerCompassPresenter::GetInstance()); RESET_PLACE_MAKER_BUTTON1->SetOnClickListener(RESET_PLACE_MAKER_BUTTON1Click); @@ -92,24 +96,13 @@ namespace OHOS RESET_PLACE_MAKER_BUTTON2->SetStyle(STYLE_BACKGROUND_OPA, 0x00); // Set additional property RESET_PLACE_MAKER_BUTTON2->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffdfdfd, UIButton::PRESSED); - RESET_PLACE_MAKER_BUTTON2->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - RESET_PLACE_MAKER_BUTTON2->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + RESET_PLACE_MAKER_BUTTON2->SetStyleForState(STYLE_BACKGROUND_OPA, 0xff0b1928, UIButton::PRESSED); // Add the CallBack about events RESET_PLACE_MAKER_BUTTON2Click = static_cast(ResetPlaceMakerCompassPresenter::GetInstance()); RESET_PLACE_MAKER_BUTTON2->SetOnClickListener(RESET_PLACE_MAKER_BUTTON2Click); // Add to scrollView1 scrollView->Add(RESET_PLACE_MAKER_BUTTON2); RESET_PLACE_MAKER_BUTTON2->SetVisible(true); - - if (image == nullptr) - { - image = new UIImageView(); - } - image->SetPosition(12, 472); - image->Resize(100, 100); - image->SetViewId("image2"); - scrollView->Add(image); - image->SetVisible(true); } void ResetPlaceMakerCompassView::DeInitView() @@ -130,11 +123,6 @@ namespace OHOS delete COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE; COMPASS_RESET_PLACE_MAKER_BACKGROUND_IMAGE = nullptr; } - if (image != nullptr) - { - delete image; - image = nullptr; - } if (RESET_PLACE_MAKER_BUTTON1 != nullptr) { delete RESET_PLACE_MAKER_BUTTON1; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/StartPathRecordCompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/StartPathRecordCompassView.cpp index 0571bfebb..f278196a2 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/StartPathRecordCompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/StartPathRecordCompassView.cpp @@ -1,7 +1,8 @@ #include "StartPathRecordCompassView.h" #include "StartPathRecordCompassPresenter.h" - #include "UiConfig.h" +#include "common/image_cache_manager.h" +#include "ui_resource_image.h" /*路径记录需要修改:记录路径的时候有类似水滴滴落水面的波纹效果*/ namespace OHOS @@ -42,7 +43,8 @@ namespace OHOS } COMPASS_START_PATH_RECORD_IMAGE->SetPosition(0, 0); COMPASS_START_PATH_RECORD_IMAGE->Resize(466, 466); - COMPASS_START_PATH_RECORD_IMAGE->SetSrc(PNG_COMPASS_START_PATH_RECORD_IMAGE); + ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(COMPASS_START_PATH_RECORD, COMPASS_IAMGES); + COMPASS_START_PATH_RECORD_IMAGE->SetSrc(image); container_->Add(COMPASS_START_PATH_RECORD_IMAGE); COMPASS_START_PATH_RECORD_IMAGE->SetVisible(true); // Add Button to App @@ -59,8 +61,7 @@ namespace OHOS // Set additional property COMPASS_START_PATH_RECORD_BUTTON->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); - COMPASS_START_PATH_RECORD_BUTTON->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - COMPASS_START_PATH_RECORD_BUTTON->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + COMPASS_START_PATH_RECORD_BUTTON->SetStyleForState(STYLE_BACKGROUND_OPA, 0xff0b1928, UIButton::PRESSED); COMPASS_START_PATH_RECORD_BUTTON->SetStyleForState(STYLE_BORDER_RADIUS, 100, UIButton::PRESSED); // Add the CallBack about events diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp index c12093c5b..eb7185bf1 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp @@ -168,10 +168,10 @@ bool ScreenModels::LoadAppImages(std::string file, UIImageView *view, uint32_t r void ScreenModels::PreLoadAppimages(void) { - LoadAppMultiImages(PLAYER_IAMGES, PLAYER_PLAYERSMODEL_RANDOM, PLAYER_PLAY); + LoadAppMultiImages(PLAYER_IAMGES, PLAYER_BACKGROUND, PLAYER_PLAYING); LoadAppMultiImages(DIAL_CLOCK, CLOCK_HAND24HOUR_IMAGE_PATH, CLOCK_TUESDAY_IMAGE_PATH); //LoadAppMultiImages(CLOCK_IAMGES, CLOCK_HAND24HOUR_IMAGE_PATH, CLOCK_TUESDAY_IMAGE_PATH); - LoadAppMultiImages(COMPASS_IAMGES, COMPASS_ROTATE_CENTER_IMAGE, COMPASS_COMPASS); + LoadAppMultiImages(COMPASS_IAMGES, COMPASS_COMPASS0, COMPASS_START_PATH_RECORD); LoadAppMultiImages(DROPDOWN_IAMGES, DROPDOWN_DROPDOWN_BLUETOOTH, DROPDOWN_DROPDOWN_BRI_SCREEN_B); LoadAppMultiImages(HEART_IAMGES, HEART_HEARTRATECOOR, HEART_HEARTRATE_TOP); } diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_BACK_TRACKING.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_BACK_TRACKING.bin deleted file mode 100644 index eb9a17e01..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_BACK_TRACKING.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_BACK_TRACKING_EARLY.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_BACK_TRACKING_EARLY.bin deleted file mode 100644 index d94c849ce..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_BACK_TRACKING_EARLY.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_PATH_RECORD.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_PATH_RECORD.bin deleted file mode 100644 index 4d847352d..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_END_PATH_RECORD.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_GPS_LOSS.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_GPS_LOSS.bin deleted file mode 100644 index f14758991..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_GPS_LOSS.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_PATH_BACKTRACKING.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_PATH_BACKTRACKING.bin deleted file mode 100644 index 6e203b391..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_PATH_BACKTRACKING.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_PATH_BACKTRACKING_DIRECT.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_PATH_BACKTRACKING_DIRECT.bin deleted file mode 100644 index 9025b565d..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_PATH_BACKTRACKING_DIRECT.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_RESET_PLACE_MAKER_BACKGROUND.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_RESET_PLACE_MAKER_BACKGROUND.bin deleted file mode 100644 index 307b505f8..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_RESET_PLACE_MAKER_BACKGROUND.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_START_PATH_RECORD.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_START_PATH_RECORD.bin deleted file mode 100644 index 6684c3cec..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/COMPASS_START_PATH_RECORD.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/MAKER_POINT_BACKGROUND.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/MAKER_POINT_BACKGROUND.bin deleted file mode 100644 index eb172a455..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/MAKER_POINT_BACKGROUND.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/PLACE_MAKER_BACKGROUND.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/PLACE_MAKER_BACKGROUND.bin deleted file mode 100644 index 19dcbe371..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/PLACE_MAKER_BACKGROUND.bin and /dev/null differ 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 8b5b2dbef..407b171df 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 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass0.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass0.bin deleted file mode 100644 index 937d73d00..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass0.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass1.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass1.bin deleted file mode 100644 index b03f5e344..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass1.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass2.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass2.bin deleted file mode 100644 index 7ffd4d8a8..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass2.bin and /dev/null differ