From dbd20b38da5791fea7b4661d68c8568937fa8bbb Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Fri, 27 Sep 2024 18:36:25 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E6=B1=BA=E8=93=9D=E7=89=99=E8=80=B3?= =?utf8?q?=E6=9C=BA=E7=95=8C=E9=9D=A2=E5=92=8C=E5=A3=B0=E9=9F=B3=E4=B8=8E?= =?utf8?q?=E9=9C=87=E5=8A=A8=E7=95=8C=E9=9D=A2=E5=86=85=E5=AD=98=E6=B3=84?= =?utf8?q?=E6=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/ClassicBlueToothView.cpp | 5 + .../include/SoundAndVibrationView.h | 20 +-- .../soundandvibration/src/CallVolumeView.cpp | 24 ++- .../src/SoundAndVibrationView.cpp | 151 ++++++++++-------- .../SoundAndVibrationVolumeSettingView.cpp | 28 ++-- .../src/SystemVolumeView.cpp | 26 ++- .../src/VibrationModeView.cpp | 30 ++-- 7 files changed, 173 insertions(+), 111 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp index 789145744..d9fd09177 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp @@ -61,6 +61,11 @@ namespace OHOS delete TradionalBlueToothLabel; TradionalBlueToothLabel = nullptr; } + if (BluetoothServiceOptionsLabel != nullptr) + { + delete BluetoothServiceOptionsLabel; + BluetoothServiceOptionsLabel = nullptr; + } if (AttentionLabel != nullptr) { delete AttentionLabel; diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationView.h b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationView.h index b46b0683f..5da2cea1f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-19 21:03:26 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-20 15:01:12 + * @LastEditTime: 2024-09-27 17:45:34 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationView.h */ #ifndef SOUND_AND_VIBRATION_VIEW_H @@ -88,14 +88,16 @@ namespace OHOS private: UIScrollView *SoundAndVibrationScrollView[MAX_SOUNDANDVIBRATIONVIEWID]{nullptr}; UILabelExt *Title{nullptr}; // 标题:“声音与震动” - UILabelButtonExt *SystemVolumeButton{nullptr}; // 系统音量按钮 - UILabelButtonExt *CallVolumeButton{nullptr}; // 通话音量按钮 - UILabelButtonExt *VibrationReminderButton{nullptr}; // 震动提醒按钮 - UILabelButtonExt *SilentModeButton{nullptr}; // 静音模式按钮 - UILabelExt *SystemVolumeLabel{nullptr}; // 系统音量标签 - UILabelExt *CallVolumeLabel{nullptr}; // 通话音量标签 - UILabelExt *VibrationReminderLabel{nullptr}; // 震动提醒标签 - UILabelExt *SilentModeLabel{nullptr}; // 静音模式标签 + // UILabelButtonExt *SystemVolumeButton{nullptr}; // 系统音量按钮 + // UILabelButtonExt *CallVolumeButton{nullptr}; // 通话音量按钮 + // UILabelButtonExt *VibrationReminderButton{nullptr}; // 震动提醒按钮 + // UILabelButtonExt *SilentModeButton{nullptr}; // 静音模式按钮 + // UILabelExt *SystemVolumeLabel{nullptr}; // 系统音量标签 + // UILabelExt *CallVolumeLabel{nullptr}; // 通话音量标签 + // UILabelExt *VibrationReminderLabel{nullptr}; // 震动提醒标签 + // UILabelExt *SilentModeLabel{nullptr}; // 静音模式标签 + UILabelButtonExt *buttonPointers[4]{nullptr}; + UILabelExt *labelPointers[4]{nullptr}; UIToggleButton *SilentModeToggleButton{nullptr}; // 静音模式切换按钮 bool initViewStatus{false}; UIImageView *temp{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumeView.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumeView.cpp index a78d37d0c..7ffafebaf 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumeView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumeView.cpp @@ -38,26 +38,36 @@ namespace OHOS delete container_; container_ = nullptr; } - + if (CallVolumeScrollView != nullptr) + { + CallVolumeScrollView = nullptr; + } delete p_SoundAndVibrationVolumeSettingView; p_SoundAndVibrationVolumeSettingView = nullptr; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallVolumeView::ClearAll end!!"); } } UIScrollView *CallVolumeView::CallVolumeViewInit(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallVolumeView::CallVolumeViewInit"); - p_SoundAndVibrationVolumeSettingView = new SoundAndVibrationVolumeSettingView(CALL_VOLUME); if (p_SoundAndVibrationVolumeSettingView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallVolumeView::p_SoundAndVibrationVolumeSettingView is nullptr!"); - return nullptr; + p_SoundAndVibrationVolumeSettingView = new SoundAndVibrationVolumeSettingView(CALL_VOLUME); + if (p_SoundAndVibrationVolumeSettingView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallVolumeView::p_SoundAndVibrationVolumeSettingView is nullptr!"); + return nullptr; + } } - CallVolumeScrollView = p_SoundAndVibrationVolumeSettingView->SetUpVolumeProcess(); if (CallVolumeScrollView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallVolumeView::CallVolumeScrollView is nullptr!"); - return nullptr; + CallVolumeScrollView = p_SoundAndVibrationVolumeSettingView->SetUpVolumeProcess(); + if (CallVolumeScrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallVolumeView::CallVolumeScrollView is nullptr!"); + return nullptr; + } } return CallVolumeScrollView; diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationView.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationView.cpp index 1b8aca042..5eaa7ba8d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-19 10:39:14 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-20 15:12:30 + * @LastEditTime: 2024-09-27 18:30:07 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationView.cpp */ #include "soundandvibration/include/SoundAndVibrationView.h" @@ -49,62 +49,59 @@ namespace OHOS void SoundAndVibrationView::ClearAll() { - if (container_ != nullptr) + if (initViewStatus == true) { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - - if (initViewStatus) - { - if (SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] != nullptr) + if (container_ != nullptr) { - SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->RemoveAll(); - - delete Title; - Title = nullptr; - - delete SystemVolumeButton; - SystemVolumeButton = nullptr; - - delete CallVolumeButton; - CallVolumeButton = nullptr; - - delete VibrationReminderButton; - VibrationReminderButton = nullptr; - - delete SilentModeButton; - SilentModeButton = nullptr; - - delete SilentModeToggleButton; - SilentModeToggleButton = nullptr; - - delete SystemVolumeLabel; - SystemVolumeLabel = nullptr; - - delete CallVolumeLabel; - CallVolumeLabel = nullptr; - - delete VibrationReminderLabel; - VibrationReminderLabel = nullptr; - - delete SilentModeLabel; - SilentModeLabel = nullptr; - - delete temp; - temp = nullptr; - - delete SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]; - SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] = nullptr; + container_->RemoveAll(); + if (SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] != nullptr) + { + SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->RemoveAll(); + if (Title != nullptr) + { + delete Title; + Title = nullptr; + } + for (int i = 0; i < 4; i++) + { + if (buttonPointers[i] != nullptr) + { + delete buttonPointers[i]; + buttonPointers[i] = nullptr; + } + if (labelPointers[i] != nullptr) + { + delete labelPointers[i]; + labelPointers[i] = nullptr; + } + } + if (SilentModeToggleButton != nullptr) + { + delete SilentModeToggleButton; + SilentModeToggleButton = nullptr; + } + if (temp != nullptr) + { + delete temp; + temp = nullptr; + } + delete SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]; + SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] = nullptr; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::ClearAll end!!"); + } + delete container_; + container_ = nullptr; } } - if (vibrationModeView != nullptr) { delete vibrationModeView; vibrationModeView = nullptr; } + for (int i = SOUNDANDVIBRATIONVIEW; i < MAX_SOUNDANDVIBRATIONVIEWID; i++) + { + SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] = nullptr; + } } /// @brief 声音与震动视图"scrollView"视图初始化 @@ -112,11 +109,14 @@ namespace OHOS /// @return true 初始化成功 false 初始化失败 bool SoundAndVibrationView::InitSoundAndVibrationScrollView(void) { - SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] = new UIScrollView(); if (SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::new SoundAndVibrationScrollView[%d] fail!", SOUNDANDVIBRATIONVIEW); - return false; + SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] = new UIScrollView(); + if (SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::new SoundAndVibrationScrollView[%d] fail!", SOUNDANDVIBRATIONVIEW); + return false; + } } SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->SetStyle(STYLE_BACKGROUND_OPA, 0xff); @@ -159,11 +159,14 @@ namespace OHOS /// @return true 初始化成功 false 初始化失败 bool SoundAndVibrationView::InitSoundAndVibrationViewTitleLabel(void) { - Title = new UILabelExt(); if (Title == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::Title new fail!"); - return false; + Title = new UILabelExt(); + if (Title == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::Title new fail!"); + return false; + } } Title->SetPosition(83, 50, 300, 35); Title->SetStyle(STYLE_TEXT_FONT, 30); @@ -187,7 +190,7 @@ namespace OHOS {392, STR_VIBRATION_MODE}, {512, STR_SILENT_MODE}, }; - UILabelExt *labelPointers[] = {SystemVolumeLabel, CallVolumeLabel, VibrationReminderLabel, SilentModeLabel}; + // UILabelExt *labelPointers[] = {SystemVolumeLabel, CallVolumeLabel, VibrationReminderLabel, SilentModeLabel}; for (int i = 0; i < sizeof(labelSetups) / sizeof(labelSetups[0]); ++i) { labelConfig = { @@ -200,11 +203,14 @@ namespace OHOS .textId = labelSetups[i].textId, .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; - labelPointers[i] = SetUpLabel_Ext(labelConfig); if (labelPointers[i] == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::labelPointers[%d] new fail!", i); - return false; + labelPointers[i] = SetUpLabel_Ext(labelConfig); + if (labelPointers[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::labelPointers[%d] new fail!", i); + return false; + } } SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->Add(labelPointers[i]); } @@ -259,7 +265,7 @@ namespace OHOS {480, SILENT_MODE_BUTTON, false}, }; - UILabelButtonExt *buttonPointers[] = {SystemVolumeButton, CallVolumeButton, VibrationReminderButton, SilentModeButton}; + // UILabelButtonExt *buttonPointers[] = {SystemVolumeButton, CallVolumeButton, VibrationReminderButton, SilentModeButton}; for (int i = 0; i < sizeof(buttonSetups) / sizeof(buttonSetups[0]); ++i) { @@ -270,11 +276,14 @@ namespace OHOS .h = 100, .ViewId = buttonSetups[i].viewId, }; - buttonPointers[i] = SetUpButton_Ext(buttonconfig, buttonSetups[i].clickEffect); if (buttonPointers[i] == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::Button[%d] new fail!", i); - return false; + buttonPointers[i] = SetUpButton_Ext(buttonconfig, buttonSetups[i].clickEffect); + if (buttonPointers[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::Button[%d] new fail!", i); + return false; + } } SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->Add(buttonPointers[i]); } @@ -285,11 +294,14 @@ namespace OHOS bool SoundAndVibrationView::InitSoundAndVibrationToggleButton(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::InitSoundAndVibrationToggleButton"); - SilentModeToggleButton = new UIToggleButton(); if (SilentModeToggleButton == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::SilentModeToggleButton new fail!"); - return false; + SilentModeToggleButton = new UIToggleButton(); + if (SilentModeToggleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::SilentModeToggleButton new fail!"); + return false; + } } SilentModeToggleButton->SetPosition(298, 505, 100, 50); SilentModeToggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); @@ -390,11 +402,14 @@ namespace OHOS if (SoundAndVibrationScrollView[thisView] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::ChangeVibrationModeView"); - vibrationModeView = new VibrationModeView(); if (vibrationModeView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView:: new scrollView[%d] fail", thisView); - return false; + vibrationModeView = new VibrationModeView(); + if (vibrationModeView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView:: new scrollView[%d] fail", thisView); + return false; + } } SoundAndVibrationScrollView[thisView] = vibrationModeView->VibrationModeViewInit(); container_->Add(SoundAndVibrationScrollView[thisView]); diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingView.cpp index f4254f40d..cbaa8151a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingView.cpp @@ -52,6 +52,7 @@ namespace OHOS } delete ScrollView; ScrollView = nullptr; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationVolumeSettingView::ClearAll end!!"); } } } @@ -76,21 +77,27 @@ namespace OHOS UIScrollView *SoundAndVibrationVolumeSettingView::SetUpVolumeProcess(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationVolumeSettingView::SetUpVolumeProcess"); - ScrollView = new UIScrollView(); if (ScrollView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationVolumeSettingView::ScrollView new fail"); - return nullptr; + ScrollView = new UIScrollView(); + if (ScrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationVolumeSettingView::ScrollView new fail"); + return nullptr; + } } ScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); ScrollView->SetDraggable(true); ScrollView->SetTouchable(true); /* ------------------------------ VolumeProcess ----------------------------- */ - VolumeProcess = new UISlider(); if (VolumeProcess == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeProcess new fail"); - return nullptr; + VolumeProcess = new UISlider(); + if (VolumeProcess == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeProcess new fail"); + return nullptr; + } } VolumeProcess->SetSliderColor(Color::Gray(), Color::Silver()); VolumeProcess->SetPosition(167, 77, 130, 310); @@ -107,11 +114,14 @@ namespace OHOS VolumeProcess->RequestFocus(); VolumeProcess->SetRotateFactor(1.0); /* ------------------------------- VolumeVetor ------------------------------ */ - VolumeVetor = new UIImageView(); if (VolumeVetor == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeVetor new fail"); - return nullptr; + VolumeVetor = new UIImageView(); + if (VolumeVetor == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeVetor new fail"); + return nullptr; + } } VolumeVetor->SetPosition(213, 213, 40, 40); VolumeVetor->SetSrc(VOLUMECONTROLVECTORIMAGEPATH); diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumeView.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumeView.cpp index 398f61a1e..f81f29a6d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumeView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumeView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-12 11:44:04 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-26 18:56:26 + * @LastEditTime: 2024-09-27 18:01:41 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumeView.cpp */ #include "soundandvibration/include/SystemVolumeView.h" @@ -48,26 +48,36 @@ namespace OHOS delete container_; container_ = nullptr; } - + if (SystemVolumeScrollView != nullptr) + { + SystemVolumeScrollView = nullptr; + } delete p_SoundAndVibrationVolumeSettingView; p_SoundAndVibrationVolumeSettingView = nullptr; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemVolumeView::ClearAll end!!"); } } UIScrollView *SystemVolumeView::SystemVolumeViewInit(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemVolumeView::SystemVolumeViewInit"); - p_SoundAndVibrationVolumeSettingView = new SoundAndVibrationVolumeSettingView(SYSTEM_VOLUME); if (p_SoundAndVibrationVolumeSettingView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemVolumeView::p_SoundAndVibrationVolumeSettingView is nullptr!"); - return nullptr; + p_SoundAndVibrationVolumeSettingView = new SoundAndVibrationVolumeSettingView(SYSTEM_VOLUME); + if (p_SoundAndVibrationVolumeSettingView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemVolumeView::p_SoundAndVibrationVolumeSettingView is nullptr!"); + return nullptr; + } } - SystemVolumeScrollView = p_SoundAndVibrationVolumeSettingView->SetUpVolumeProcess(); if (SystemVolumeScrollView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemVolumeView::SystemVolumeScrollView is nullptr!"); - return nullptr; + SystemVolumeScrollView = p_SoundAndVibrationVolumeSettingView->SetUpVolumeProcess(); + if (SystemVolumeScrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemVolumeView::SystemVolumeScrollView is nullptr!"); + return nullptr; + } } return SystemVolumeScrollView; diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/VibrationModeView.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/VibrationModeView.cpp index 4cbd6c264..7e6d001d6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/VibrationModeView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/VibrationModeView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-22 14:35:22 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-07-24 17:49:58 + * @LastEditTime: 2024-09-27 18:14:37 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/VibrationModeView.cpp */ #include "soundandvibration/include/VibrationModeView.h" @@ -63,6 +63,7 @@ namespace OHOS delete scrollView; scrollView = nullptr; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationModeView::ClearAll end!!"); } } @@ -88,11 +89,14 @@ namespace OHOS } scrollView->SetOnDragListener(dragListener); /* -------------------------------------------------------------------------- */ - Title = new UILabelExt(); if (Title == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationModeView::Title is nullptr!"); - return nullptr; + Title = new UILabelExt(); + if (Title == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationModeView::Title is nullptr!"); + return nullptr; + } } Title->SetPosition(93, 50, 280, 40); Title->SetStyle(STYLE_TEXT_FONT, 30); @@ -104,11 +108,14 @@ namespace OHOS Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); scrollView->Add(Title); /* -------------------------------------------------------------------------- */ - VibrationModePicker = new UIPicker(); if (VibrationModePicker == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationModeView::VibrationModePicker is nullptr!"); - return nullptr; + VibrationModePicker = new UIPicker(); + if (VibrationModePicker == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationModeView::VibrationModePicker is nullptr!"); + return nullptr; + } } VibrationModePicker->SetPosition(43, 110, 380, 240); VibrationModePicker->SetViewId("VibrationModePicker"); @@ -162,11 +169,14 @@ namespace OHOS VibrationModePicker->SetSelected(ConfigModel::GetInstance()->GetVibrationReminder()); scrollView->Add(VibrationModePicker); /* -------------------------------------------------------------------------- */ - VibrationModeLabelButton = new UILabelButtonExt(); if (VibrationModeLabelButton == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationModeView::VibrationModeLabelButton is nullptr!"); - return nullptr; + VibrationModeLabelButton = new UILabelButtonExt(); + if (VibrationModeLabelButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationModeView::VibrationModeLabelButton is nullptr!"); + return nullptr; + } } VibrationModeLabelButton->SetPosition(0, 366, 466, 100); VibrationModeLabelButton->SetImageSrc(PNG_BUTTON_466x100_IMAGE, PNG_BUTTON_466x100_IMAGE); -- 2.17.1