部分代码更新 189/1 189/head 192/target/1
authorluozheng <1732036298@qq.com>
Wed, 29 May 2024 08:12:33 +0000 (16:12 +0800)
committerluozheng <1732036298@qq.com>
Wed, 29 May 2024 08:12:33 +0000 (16:12 +0800)
17 files changed:
code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmMaxClock.cpp
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp
code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp
code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinParser.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinTypes.h
code/sdk/application/wearable/fd230app/nativeui/main/include/VolumeSettingPresenter.h
code/sdk/application/wearable/fd230app/nativeui/main/include/VolumeSettingView.h
code/sdk/application/wearable/fd230app/nativeui/main/src/VolumeSettingPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/VolumeSettingView.cpp
code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistView.cpp
code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersPresenter.h
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationModel.cpp
code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp

index 823ff67..e2bbd4f 100644 (file)
@@ -19,8 +19,6 @@ namespace OHOS {
 osTimerId_t g_stopAlarmMaxHandle = nullptr;\r
 static AlarmMaxClock *g_AlarmMaxClock = nullptr;\r
 static constexpr uint64_t MS_THREE_SECONDS = 3000;\r
-void ScanTimerCallback(int data);\r
-void EndScanHandle(void);\r
 \r
 static AlarmMaxClock *g_JudgeView = nullptr;\r
 constexpr int16_t CONTAINER_X = 0;\r
@@ -104,7 +102,7 @@ void CancelScanHandle(void)
     }\r
 }\r
 \r
-void EndScanHandle(void)\r
+static void EndScanHandle(void)\r
 {\r
     OHOS::MainAlarmView::GetInstance()->ChangeView(CHANGE_INTERFACE_MAXCLOCK, MAIN_INTERFACE);\r
 }\r
@@ -117,7 +115,7 @@ static void ScanTimerCallbackProc(int data)
     EndScanHandle();\r
 }\r
 \r
-void ScanTimerCallback(int data)\r
+static void ScanTimerCallback(int data)\r
 {\r
     GraphicService::GetInstance()->PostGraphicEvent(std::bind(ScanTimerCallbackProc, data));\r
 }\r
index e7f807c..2cfca9c 100644 (file)
@@ -155,7 +155,7 @@ void CancelBrScanHandle(void)
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CancelBtDiscovery results %d", results);\r
 }\r
 \r
-void EndScanHandle(void)\r
+static void EndScanHandle(void)\r
 {\r
     if (BluetoothModel::GetInstance()->GetCase().size() == 0) {\r
         BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance();\r
@@ -210,7 +210,7 @@ static void ScanTimerCallbackProc(int data)
     EndScanHandle();\r
 }\r
 \r
-void ScanTimerCallback(int data)\r
+static void ScanTimerCallback(int data)\r
 {\r
     GraphicService::GetInstance()->PostGraphicEvent(std::bind(ScanTimerCallbackProc, data));\r
 }\r
index e1d2e64..3f88523 100644 (file)
@@ -106,8 +106,8 @@ namespace OHOS
                 }
             }
 
-            return true;
         }
+         return true;
     }
 
     bool BluetoothServiceOptionsPresenter::OnDrag(UIView &view, const DragEvent &event)
index ef8fb9c..6337536 100644 (file)
@@ -15,7 +15,7 @@
 #include "language/LanguageInit.h"
 #include "ConfigModel.h"
 #include <NativeAbility.h>
-
+#include "AppViewIDs.h"
 namespace OHOS
 {
     // 初始化 languages 数组
diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinParser.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinParser.h
new file mode 100644 (file)
index 0000000..dc73723
--- /dev/null
@@ -0,0 +1,61 @@
+/*\r
+ * Copyright (c) 2023 CompanyNameMagicTag.\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+#ifndef GRAPHIC_LITE_DIAL_BIN_PARSER_H\r
+#define GRAPHIC_LITE_DIAL_BIN_PARSER_H\r
+#include <iostream>\r
+#include <cstring>\r
+#include "graphic_types.h"\r
+#include "DialViewGroup.h"\r
+#include "DialBinTypes.h"\r
+#include "components/ui_abstract_progress.h"\r
+\r
+namespace OHOS {\r
+class DialBinParser {\r
+public:\r
+    static DialBinParser* GetInstance(void);\r
+    bool UpdateDial(const std::string& file, FILE* fp, DialViewGroup* group);\r
+    bool GetDialPreviewInfo(FILE* fp, DialPreviewInfo* info);\r
+\r
+protected:\r
+    int32_t ParseDialHeader(FILE* file);\r
+    int32_t ParserDialStaticImg(FILE* fp);\r
+    int32_t ParserDialSequenceImg(FILE* fp);\r
+    int32_t ParserDialRotateImg(FILE* fp);\r
+    int32_t ParserDialOptionImg(FILE* fp);\r
+    int32_t ParserDialDigitalImg(FILE* fp);\r
+    int32_t ParserDialLabel(FILE* fp);\r
+    int32_t ParserDialArcLabel(FILE* fp);\r
+    int32_t ParserDialBoxProgress(FILE* fp);\r
+    int32_t ParserDialArcProgress(FILE* fp);\r
+    int32_t ParserDialVideo(FILE* fp);\r
+    int32_t ParserDialClick(FILE* fp);\r
+    int32_t ParserDialKaleidoscope(FILE* fp);\r
+\r
+private:\r
+    DialBinParser();\r
+    virtual ~DialBinParser();\r
+    void* MallocAndReadBuf(FILE* file, uint32_t readSize);\r
+    bool SetProgressType(FILE* fp, UIAbstractProgress* view, DialProgressType data);\r
+\r
+    static constexpr uint8_t DIAL_BIN_PARSER_FUNC_NUM = 12; // 12: func max value\r
+    int32_t (DialBinParser::*funcArray_[DIAL_BIN_PARSER_FUNC_NUM])(FILE*);\r
+\r
+    DialViewGroup* dialGroup_ = nullptr;\r
+    std::string file_;\r
+    uint32_t dirId_ = 0xfef << 20; // 20: offset\r
+    uint32_t imageOffset_ = 0;\r
+};\r
+}\r
+#endif\r
index 1f8f493..366c1be 100644 (file)
@@ -155,6 +155,7 @@ struct DialVideo {
     DialRect rect;\r
     uint32_t offset;\r
     Color32 colorKey;\r
+    uint32_t imgId;\r
 };\r
 \r
 struct DialClick {\r
index f18dac4..07a4156 100644 (file)
@@ -33,11 +33,12 @@ typedef enum : uint8_t {
     VOLUMEDRAG = 2,
 } VolumeChangeStatus;
 
+class VolumeSettingView;
 class VolumeSliderEventListener : public UISlider::UISliderEventListener,
                                   public UIView::OnClickListener,
                                   public UIView::OnDragListener {
 public:
-    VolumeSliderEventListener();
+    VolumeSliderEventListener(VolumeSettingView *volumeSetting);
     ~VolumeSliderEventListener();
     static VolumeSliderEventListener *GetInstance();
     void OnChange(int32_t progress) override;
@@ -50,6 +51,7 @@ public:
 private:
     int16_t preSound{0};
     int16_t playerCoefficients{0};
+    VolumeSettingView *volumeSettingView{nullptr};
 };
 } // namespace OHOS
 #endif
index efdb0d8..55740c2 100644 (file)
@@ -24,17 +24,13 @@ class VolumeSettingView : public UIViewGroup {
 public:
     VolumeSettingView();
     ~VolumeSettingView();
-    static VolumeSettingView *GetInstance(void);
     int16_t sounding{0};
 
     UISlider *GetProgress(void);
     bool SetUpVolume(void);
     UIButton *GetIncreaseButton(void);
     UIButton *GetDecreaseButton(void);
-    int get_progress_vlaue()
-    {
-        return progress->GetValue();
-    }
+    VolumeSliderEventListener *GetVolumeEventListener(void);
 private:
     VolumeSliderEventListener *listener{nullptr};
     UISlider *progress{nullptr};
index 88a3091..d823c74 100644 (file)
@@ -25,26 +25,16 @@ namespace OHOS {
 extern "C" {
 #endif
 
-static VolumeSliderEventListener *g_pVolumeSliderEventListener = nullptr;
-
 constexpr int16_t SOUND_CHANGE = 10;
 
-VolumeSliderEventListener::VolumeSliderEventListener()
+VolumeSliderEventListener::VolumeSliderEventListener(VolumeSettingView *volumeSetting) : volumeSettingView(volumeSetting)
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeSliderEventListener new");
-    g_pVolumeSliderEventListener = this;
 }
 
 VolumeSliderEventListener::~VolumeSliderEventListener()
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeSliderEventListener::~VolumeSliderEventListener");
-    g_pVolumeSliderEventListener = nullptr;
-}
-
-VolumeSliderEventListener *VolumeSliderEventListener::GetInstance()
-{
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeSliderEventListener GetInstance");
-    return g_pVolumeSliderEventListener;
 }
 
 bool VolumeSliderEventListener::OnClick(UIView& view, const ClickEvent& event)
@@ -67,11 +57,6 @@ bool VolumeSliderEventListener::OnClick(UIView& view, const ClickEvent& event)
 void VolumeSliderEventListener::ChangeVolume(VolumeChangeStatus status)
 {
     ImageInfo *image;
-    VolumeSettingView *volumeSettingView = VolumeSettingView::GetInstance();
-    if (volumeSettingView == nullptr) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick:volumeSettingView new fail");
-        return;
-    }
     UISlider *progress = volumeSettingView->GetProgress();
     if (progress == nullptr) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick:progress new fail");
@@ -85,7 +70,7 @@ void VolumeSliderEventListener::ChangeVolume(VolumeChangeStatus status)
 
     preSound = volumeSettingView->sounding;
     if (status == VOLUMEUP) {
-        volumeSettingView->sounding  = progress->GetValue() + SOUND_CHANGE;
+        volumeSettingView->sounding = progress->GetValue() + SOUND_CHANGE;
         if (volumeSettingView->sounding > VOLUME_MAX) {
             volumeSettingView->sounding = VOLUME_MAX;
         }
@@ -136,8 +121,7 @@ void VolumeSliderEventListener::ChangeVolume(VolumeChangeStatus status)
         BtAndLocalVolumeSet(volumeSettingView->sounding);
     }
     if (playerCoefficients == VOLUMEPHONE || playerCoefficients == VOLUMEPHONENOTIFY) {
-        unsigned char volumeValue;
-        volumeValue = (unsigned char) ((double) (volumeSettingView->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换
+        unsigned char volumeValue = (unsigned char) ((double) (volumeSettingView->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换
         SetSpeakerVolume(volumeValue);
     }
 }
@@ -145,14 +129,13 @@ void VolumeSliderEventListener::ChangeVolume(VolumeChangeStatus status)
 extern BtAvrcpTgInf g_avrcp_srv_inf;
 void VolumeSliderEventListener::BtAndLocalVolumeSet(int16_t sounding)
 {
-    WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "BtAndLocalVolumeSet %d", sounding);
     if (g_avrcp_srv_inf.avrcp_srv_conn_stat == PROFILE_STATE_CONNECTED) {
         uint8_t volume = sounding * AVRCP_ABSOLUTE_VOLUME_PERCENTAGE_100 / 100; // 100:本地音量最大值
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "volume 0x%x", volume);
+        WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "avrcp volume = %d", volume);
         (void)avrcp_ct_set_absolute_volume(&(g_avrcp_srv_inf.bd_addr), volume); // 手表音量设置同步远端BT音量
-    } else {
-        AudioManager::GetInstance().SetVolume(AUDIO_STREAM_MUSIC, sounding); // 本地音量设置
     }
+    WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "audio volume = %d", sounding);
+    AudioManager::GetInstance().SetVolume(AUDIO_STREAM_MUSIC, sounding); // 本地音量设置
 }
 
 void VolumeSliderEventListener::OnRelease(int32_t value)
@@ -174,11 +157,6 @@ void VolumeSliderEventListener::OnChange(int32_t value)
 
 bool VolumeSliderEventListener::OnDrag(UIView& view, const DragEvent& event)
 {
-    VolumeSettingView *volumeSettingView = VolumeSettingView::GetInstance();
-    if (volumeSettingView == nullptr) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnDrag::volumeSettingView new fail");
-        return false;
-    }
     if (strcmp(view.GetViewId(), VOLUME_VIEW) == 0) {
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) {
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeSliderEventListener::OnDrag");
@@ -215,4 +193,4 @@ bool VolumeSliderEventListener::OnDrag(UIView& view, const DragEvent& event)
 #ifdef __cplusplus
 }
 #endif
-}
+}
\ No newline at end of file
index 4276373..89e2da8 100644 (file)
@@ -10,7 +10,6 @@
 #include "ui_resource_image.h"
 
 namespace OHOS {
-static VolumeSettingView *g_pVolumeSettingView{nullptr};
 static constexpr uint16_t BUTTON_X = 182;
 static constexpr uint16_t BUTTON_Y = 0;
 static constexpr uint16_t BUTTON_Y2 = 363;
@@ -27,18 +26,15 @@ constexpr int16_t VOLUME_ERROR = (-1);
 VolumeSettingView::VolumeSettingView()
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeSettingView::VolumeSettingView");
-    g_pVolumeSettingView = this;
 }
 
 VolumeSettingView::~VolumeSettingView()
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeSettingView::~VolumeSettingView");
     RemoveAll();
-
-    UIView::OnClickListener *click = increaseButton->GetOnClickListener();
-    if (click != nullptr) {
-        delete click;
-        click = nullptr;
+    if (listener != nullptr) {
+        delete listener;
+        listener = nullptr;
     }
     delete increaseButton;
     increaseButton = nullptr;
@@ -48,13 +44,6 @@ VolumeSettingView::~VolumeSettingView()
 
     delete progress;
     progress = nullptr;
-
-    g_pVolumeSettingView = nullptr;
-}
-
-VolumeSettingView *VolumeSettingView::GetInstance(void)
-{
-    return g_pVolumeSettingView;
 }
 
 bool VolumeSettingView::SetUpVolume(void)
@@ -78,7 +67,7 @@ bool VolumeSettingView::SetUpVolume(void)
     progress->SetRange(VOLUME_MAX, VOLUME_MIN);
 
     if (listener == nullptr) {
-        listener = new VolumeSliderEventListener();
+        listener = new VolumeSliderEventListener(this);
         if (listener == nullptr) {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "listener new fail");
             return false;
@@ -88,9 +77,8 @@ bool VolumeSettingView::SetUpVolume(void)
     progress->SetOnClickListener(listener);
     progress->SetOnDragListener(listener);
     progress->SetKnobStyle(StyleDefault::GetSliderKnobStyle());
-    UIView::OnDragListener *volDragListener = (UIView::OnDragListener *)OHOS::VolumeSliderEventListener::GetInstance();
     SetViewId(VOLUME_VIEW);
-    SetOnDragListener(volDragListener);
+    SetOnDragListener(listener);
     SetDraggable(true);
     SetTouchable(true);
     Add(progress);
@@ -117,7 +105,6 @@ UIButton *VolumeSettingView::GetDecreaseButton(void)
 int VolumeSettingView::ShowVolume(void)
 {
     ImageInfo *image;
-    UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::VolumeSliderEventListener::GetInstance();
     if (increaseButton == nullptr) {
         increaseButton = new UIButton();
         if (increaseButton == nullptr) {
@@ -129,7 +116,7 @@ int VolumeSettingView::ShowVolume(void)
     increaseButton->SetViewId(INCREASE_BUTTON);
     image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_INCREASE_BUTTON, PLAYER_IAMGES);
     increaseButton->SetImageSrc(image, image);
-    increaseButton->SetOnClickListener(clickListener);
+    increaseButton->SetOnClickListener(listener);
     Add(increaseButton);
 
     if (decreaseButton == nullptr) {
@@ -143,9 +130,15 @@ int VolumeSettingView::ShowVolume(void)
     decreaseButton->SetViewId(DECREASE_BUTTON);
     image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_DECREASE_BUTTON, PLAYER_IAMGES);
     decreaseButton->SetImageSrc(image, image);
-    decreaseButton->SetOnClickListener(clickListener);
+    decreaseButton->SetOnClickListener(listener);
     Add(decreaseButton);
 
     return VOLUME_OK;
 }
+
+VolumeSliderEventListener *VolumeSettingView::GetVolumeEventListener(void)
+{
+    return listener;
+}
+
 }
index 5cd75bf..005f654 100644 (file)
@@ -114,7 +114,7 @@ bool VocassistPresenter::OnDrag(UIView& view, const DragEvent& event)
         strcmp(view.GetViewId(), VOC_ID) == 0) { // 语音助手右滑退出
         int phoneStatus = VocassistModel::GetInstance()->GetPhoneDetailStatus();    // 扫描设置此时通话的状态和个数
         if (phoneStatus == ONE_ROAD_AND_INCOMING) {
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL);
         } else {
             NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
         }
index 777adfe..9f73787 100644 (file)
@@ -632,7 +632,7 @@ void VoiceAssistance::ExitProgress()
         if (quitStatus == CONTINUTE_EXIT_MODE1) {\r
             int phoneStatus = VocassistModel::GetInstance()->GetPhoneDetailStatus();    // 扫描设置此时通话的状态和个数\r
             if (phoneStatus == ONE_ROAD_AND_INCOMING) {\r
-                NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE); // 返回来电界面\r
+                NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL); // 返回来电界面\r
                 return;\r
             }\r
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Too long no operate, now exit vocassist");\r
index 9a6b473..02d263b 100644 (file)
@@ -109,8 +109,7 @@ private:
     void PlayerModelButtonOnClick();\r
     void OptionsButtonOnClick();\r
     PlayersCaseListAdapter *m_PlayersCaseListAdapter{nullptr};\r
-    VolumeSettingView *volumeSetting{nullptr};\r
-    UIViewGroup *volumeSettingView{nullptr};\r
+    VolumeSettingView *volumeSettingView{nullptr};\r
 };\r
 \r
 // 播放器回调\r
index 1137190..f1ef201 100644 (file)
@@ -545,30 +545,32 @@ void ButtonOnClickListener::PlayerButtonOnClick()
 \r
 void ButtonOnClickListener::SoundButtonOnClick()\r
 {\r
+    \r
     PlayersView *playersView = PlayersView::GetInstance();\r
     if (playersView == nullptr) {\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundButtonOnClick playersView nullptr err");\r
         return;\r
     }\r
     if (volumeSettingView == nullptr) {\r
-        volumeSetting = new VolumeSettingView();\r
-        if (volumeSetting == nullptr) {\r
+        volumeSettingView = new VolumeSettingView();\r
+        if (volumeSettingView == nullptr) {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "volumeSetting nullptr err");\r
             return;\r
         }\r
-        if (volumeSetting->SetUpVolume() == false) {\r
+        if (!volumeSettingView->SetUpVolume()) {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "volumeSetting SetUpVolume fail");\r
             return;\r
         }\r
-        volumeSetting->GetProgress()->SetValue(AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC));\r
-        if (AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC) == 0) {\r
-            ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES);\r
-            volumeSetting->GetDecreaseButton()->SetImageSrc(image, image);\r
-        }\r
-        volumeSettingView = volumeSetting;\r
         RootView::GetInstance()->Add(volumeSettingView);\r
     }\r
-    VolumeSliderEventListener *volumeSliderEventListener = VolumeSliderEventListener::GetInstance();\r
+    int32_t volume = AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC);\r
+    WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "current volume = %d", volume);\r
+    volumeSettingView->GetProgress()->SetValue(volume);\r
+    if (volume == 0) {\r
+        ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES);\r
+        volumeSettingView->GetDecreaseButton()->SetImageSrc(image, image);\r
+    }\r
+    VolumeSliderEventListener *volumeSliderEventListener = volumeSettingView->GetVolumeEventListener();\r
     if (volumeSliderEventListener == nullptr) {\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundButtonOnClick volumeSliderEventListener nullptr err");\r
         return;\r
@@ -578,6 +580,7 @@ void ButtonOnClickListener::SoundButtonOnClick()
     volumeSettingView->SetVisible(true);\r
     // 刷新UI\r
     RootView::GetInstance()->Invalidate();\r
+\r
 }\r
 \r
 void ButtonOnClickListener::OptionsButtonOnClick()\r
index 30746d3..3d0cbb2 100644 (file)
@@ -32,7 +32,7 @@ namespace OHOS
     //获取震动强度
     int SoundAndVibrationModel::GetVibrationReminderToggleButtonStaus()
     {
-        ConfigModel::GetInstance()->GetVibrationReminder();
+        return ConfigModel::GetInstance()->GetVibrationReminder();
     }
 
     /// @brief 设置“静音模式”是否开启
index 041bb3c..43ea0c1 100644 (file)
@@ -17,6 +17,7 @@
 #include "takephotos/include/TakephotosView.h"
 #include "takephotos/include/TakephotosModel.h"
 #include "NativeAbility.h"
+#include "AppViewIDs.h"
 #include "bleEvent.h"
 
 extern "C" errcode_t uapi_get_timestampe_ms(uint32_t *tm);
index 9414602..053e2e5 100644 (file)
@@ -575,6 +575,7 @@ namespace OHOS
             return UIResourceTextId::STR_ULTRA_HIGH_STRENGTH;
             break;
         default:
+            return UIResourceTextId::STR_LOWER_STRENGTH;
             break;
         }
     }
@@ -1022,7 +1023,7 @@ namespace OHOS
             char file_path[MAX_FILE_PATH_LENGTH] = {0};
             char timeday[12] = {0};
             uapi_get_YYMMDD_Time(timeday, '_');
-            sprintf_s(file_path, sizeof(file_path), "%s%s.bin", TRAINING_PATH, timeday); //防止越界
+            sprintf_s(file_path, sizeof(file_path), "%s%s.bin", TRAINING_PATH, timeday); // 防止越界
 
             // Check if the directory exists, if not, create it
             struct stat st = {0};
@@ -1059,7 +1060,7 @@ namespace OHOS
         Trainingdata *read_Trainingdata_data(char *timedata, uint16_t offset)
         {
             char file_path[128] = {0};
-            sprintf_s(file_path, sizeof(file_path), "%s%s.bin", TRAINING_PATH, timedata); //防止越界
+            sprintf_s(file_path, sizeof(file_path), "%s%s.bin", TRAINING_PATH, timedata); // 防止越界
 
             FILE *fp = fopen(file_path, "rb+");
             Trainingdata *data = (Trainingdata *)malloc(sizeof(Trainingdata));
@@ -1205,7 +1206,7 @@ namespace OHOS
         cJSON *root = cJSON_Parse(jsonData.c_str());
         cJSON *dataArray = cJSON_GetObjectItem(root, "data");
 
-        int dataCount = cJSON_GetArraySize(dataArray); //获取数组大小
+        int dataCount = cJSON_GetArraySize(dataArray); // 获取数组大小
         SportData *sportDataArray = new SportData[dataCount];
 
         for (int i = 0; i < dataCount; i++)