From 241181bc416daeeb44b14a2c73b02dd77e1d5c5a Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 28 Oct 2024 19:06:22 +0800 Subject: [PATCH] =?utf8?q?#1121,=E8=A7=A3=E5=86=B3=EF=BC=8C=E5=BC=80?= =?utf8?q?=E5=90=AF=E5=BD=95=E9=9F=B3=E6=97=B6=E5=BD=95=E9=9F=B3=E6=8C=89?= =?utf8?q?=E9=92=AE=E9=9C=80=E7=82=B9=E5=87=BB=E5=87=A0=E4=B8=8B=E6=89=8D?= =?utf8?q?=E8=83=BD=E5=81=9C=E6=AD=A2=E5=BD=95=E9=9F=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/record/include/RecordGoingView.h | 3 ++- .../nativeui/record/src/RecordGoingView.cpp | 20 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordGoingView.h b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordGoingView.h index 362811a2c..124256072 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordGoingView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordGoingView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-30 09:14:38 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-13 14:32:55 + * @LastEditTime: 2024-10-28 18:56:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordGoingView.h */ #ifndef RECORD_GOING_VIEW_H @@ -56,6 +56,7 @@ namespace OHOS UILabel *Timer{nullptr}; // 显示录音时长 UIImageView *RECORD_GOING_IMAGE{nullptr}; UIButton *RECORD_GOING_BUTTON{nullptr}; + UIButton *STOP_RECORD_GOING_BUTTON{nullptr}; }; } // namespace OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordGoingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordGoingView.cpp index 7a8a9739d..dcc249379 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordGoingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordGoingView.cpp @@ -46,6 +46,9 @@ namespace OHOS delete RecordGoingLabel; RecordGoingLabel = nullptr; + delete STOP_RECORD_GOING_BUTTON; + STOP_RECORD_GOING_BUTTON = nullptr; + delete RecordGoingViewScrollView; RecordGoingViewScrollView = nullptr; } @@ -77,6 +80,7 @@ namespace OHOS RECORD_GOING_BUTTON, Timer, RecordGoingLabel, + STOP_RECORD_GOING_BUTTON, }; int numViews = sizeof(viewsToAdd) / sizeof(viewsToAdd[0]); @@ -225,13 +229,24 @@ namespace OHOS return false; } RECORD_GOING_BUTTON->SetPosition(210, 180, 60, 60); - RECORD_GOING_BUTTON->SetViewId(RECORD_GOING_BUTTON_VIEWID); RECORD_GOING_BUTTON->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff5a36); RECORD_GOING_BUTTON->SetStyle(STYLE_BORDER_RADIUS, 20); RECORD_GOING_BUTTON->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffff5a36, UIButton::PRESSED); RECORD_GOING_BUTTON->SetStyleForState(STYLE_BORDER_RADIUS, 20, UIButton::PRESSED); + /* -------------------------------------------------------------------------- */ + STOP_RECORD_GOING_BUTTON = new UIButton(); + if (STOP_RECORD_GOING_BUTTON == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RecordGoingView::STOP_RECORD_GOING_BUTTON new fail!"); + return false; + } + STOP_RECORD_GOING_BUTTON->SetPosition(158, 129, 150, 150); + STOP_RECORD_GOING_BUTTON->SetViewId(RECORD_GOING_BUTTON_VIEWID); + STOP_RECORD_GOING_BUTTON->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff5a36); + STOP_RECORD_GOING_BUTTON->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + STOP_RECORD_GOING_BUTTON->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); UIView::OnClickListener *clickListener = static_cast(RecordingPresenter::GetInstance()); - RECORD_GOING_BUTTON->SetOnClickListener(clickListener); + STOP_RECORD_GOING_BUTTON->SetOnClickListener(clickListener); return true; } @@ -252,6 +267,7 @@ namespace OHOS RecordGoingViewScrollView->Add(RECORD_GOING_BUTTON); RecordGoingViewScrollView->Add(Timer); RecordGoingViewScrollView->Add(RecordGoingLabel); + RecordGoingViewScrollView->Add(STOP_RECORD_GOING_BUTTON); #endif return RecordGoingViewScrollView; } -- 2.17.1