From fddbc9764c8c27bd7ae4ee8c07b57eaa24983d34 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Mon, 29 Jul 2024 16:43:15 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E5=9C=A8HFP=E9=80=9A=E8=AF=9D?= =?utf8?q?=E4=B8=AD=E7=9A=84=20DTMF=E6=9C=8D=E5=8A=A1=EF=BC=88=E6=97=A2?= =?utf8?q?=E9=80=9A=E8=AF=9D=E4=B8=AD=E6=8B=A8=E5=8F=B7=E7=9B=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativelauncher/include/UiConfig.h | 10 + .../nativeui/makephone/include/CallingView.h | 21 +- .../makephone/include/MainCallingPresenter.h | 6 +- .../nativeui/makephone/src/CallingView.cpp | 245 +++++++++++++++--- .../makephone/src/MainCallingPresenter.cpp | 70 ++++- .../nativeui/phone/src/PhoneCallView.cpp | 2 +- .../nativeui/phone/src/PhoneDirView.cpp | 14 +- .../phoneservice/include/PhoneService.h | 2 + .../phoneservice/src/PhoneService.cpp | 8 + .../makephone/src/MainCallingPresenter.cpp | 1 + .../fd230/fs/user/res/makephone/Ellipse 4.bin | 3 + .../fd230/fs/user/res/makephone/dial.bin | 3 + .../fd230/fs/user/res/makephone/headset_1.bin | 3 + .../fd230/fs/user/res/makephone/headset_2.bin | 3 + .../fs/user/res/makephone/microphone.bin | 3 + .../fs/user/res/makephone/microphone_1.bin | 3 + .../fd230/fs/user/res/makephone/person.bin | 3 + .../fd230/fs/user/res/makephone/vector.bin | 3 + .../fd230/fs/user/res/makephone/voice.bin | 3 + 19 files changed, 364 insertions(+), 42 deletions(-) create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/Ellipse 4.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/dial.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_1.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_2.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone_1.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/person.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/vector.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/voice.bin diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index 28fdf4f52..cd673eeb3 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -122,6 +122,16 @@ namespace OHOS static constexpr const char *PNG_CALLER_TMAGE_PATH = APP_RES_PATH "/CALLER_LOG_IMAGE.bin"; static constexpr const char *PNG_NO_CALLER_LOG_IMAGE = APP_RES_PATH "/NO_CALLER_LOG_IMAGE.bin"; static constexpr const char *PNG_SOUNDBUTTON2 = APP_RES_PATH "/SOUND_IMAGE.bin"; + + /* ----------------------------------- 打电话图片(230) ---------------------------------- */ + static constexpr const char *PNG_230_MICROPHONE_OPEN_IMAGE_PATH = APP_RES_PATH "/makephone/microphone.bin"; + static constexpr const char *PNG_230_MICROPHONE_CLOSE_IMAGE_PATH = APP_RES_PATH "/makephone/microphone_1.bin"; + static constexpr const char *PNG_230_VOICE_OPEN_IMAGE_PATH = APP_RES_PATH "/makephone/voice.bin"; + static constexpr const char *PNG_230_PERSON_IMAGE_PATH = APP_RES_PATH "/makephone/person.bin"; + static constexpr const char *PNG_230_VECTOR_IMAGE_PATH = APP_RES_PATH "/makephone/vector.bin"; + static constexpr const char *PNG_230_DIAL_IMAGE_PATH = APP_RES_PATH "/makephone/dial.bin"; + static constexpr const char *PNG_230_HEADSET_1_IIMAGE_PATH = APP_RES_PATH "/makephone/headset_1.bin"; + static constexpr const char *PNG_230_HEADSET_2_IIMAGE_PATH = APP_RES_PATH "/makephone/headset_2.bin"; /* ---------------------------------- 血氧中图片 --------------------------------- */ static constexpr const char *PNG_BLOODOXYGEN_IMAGE_PATH = APP_RES_PATH "/BLOODOXYGEN_VIEW.bin"; static constexpr const char *PNG_PULLBUTTON_FACE_IMAGE = APP_RES_PATH "/BLOOD_FLOW_IMAGE_01.bin"; diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h index a82d4a607..a271c9e3e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h @@ -16,7 +16,7 @@ #include "ohos_types.h" #include "UiConfig.h" #include "ChangeSliceListener.h" - +#include "components/ui_label_button.h" namespace OHOS { class CallingView { @@ -28,19 +28,36 @@ public: static CallingView *GetInstance(); UILabel *GetCallingDisplayLabel(); UILabel *GetCallingDurationLabel(); + void showdial(bool); + void text_updata_buf(const char *buf); private: bool InitAddOnclickevent(void); bool InitImageViewDisplay(void); bool InitUILabelDisplay(void); + bool Initshowdial(void); - UIImageView *imageMicrophone{nullptr}; + UIViewGroup *group{nullptr}; UIView::OnClickListener* clickLeftListener{nullptr}; + UIView:: OnDragListener* dragListener{nullptr}; + + UIImageView *imageMicrophone{nullptr}; + UIImageView *imageHandUp{nullptr}; UIImageView *imageHorns{nullptr}; + + UIImageView *imagedial{nullptr}; + UIImageView *imageheadset{nullptr}; + + UIImageView *imageperson{nullptr}; UILabel *callerDisplay{nullptr}; UILabel *currentTimes{nullptr}; UILabel *callDuration{nullptr}; + + UIViewGroup *dial_group{nullptr}; + UILabelButton* labelButton[12]={nullptr}; + UIImageView *image_line{nullptr}; + UILabel * label_number{nullptr}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/MainCallingPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/MainCallingPresenter.h index 9973279ce..b2093b61d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/MainCallingPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/MainCallingPresenter.h @@ -16,7 +16,9 @@ namespace OHOS { class MainCallingView; -class MainCallingPresenter : public Presenter, public UIView::OnClickListener { +class MainCallingPresenter : public Presenter, + public UIView::OnClickListener , + public UIView::OnDragListener{ public: MainCallingPresenter(); ~MainCallingPresenter() override; @@ -31,6 +33,8 @@ public: bool CallingViewDisplay(); bool InitPointerValue(); bool OnClick(UIView& view, const ClickEvent& event) override; + + bool OnDragEnd(UIView &view, const DragEvent &event) override; VolumeSettingView *GetvolumeSetting(); private: int changeImage{0}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp index 3034ea70d..ac557a501 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp @@ -8,7 +8,7 @@ #include "MainCallingPresenter.h" #include "wearable_log.h" #include "UiConfig.h" - +#include "PhoneService.h" namespace OHOS { static constexpr uint16 MATH_ZERO = 0; @@ -68,6 +68,26 @@ CallingView::~CallingView() delete group; group = nullptr; + if(dial_group) + { + dial_group->RemoveAll(); + for( int i=0;i<12;i++) + { + delete labelButton[i]; + labelButton[i]=nullptr; + } + delete image_line; + image_line= nullptr; + + + delete label_number; + label_number= nullptr; + + delete dial_group; + dial_group = nullptr; + } + + g_pMainView = nullptr; } @@ -86,7 +106,13 @@ bool CallingView::InitAddOnclickevent() imageMicrophone->SetOnClickListener(clickLeftListener); imageHandUp->SetOnClickListener(clickLeftListener); imageHorns->SetOnClickListener(clickLeftListener); + imagedial->SetOnClickListener(clickLeftListener); + + for( int i=0;i<12;i++) + { + labelButton[i]->SetOnClickListener(clickLeftListener); + } return true; } @@ -102,18 +128,19 @@ bool CallingView::InitImageViewDisplay() if (imageMicrophone == nullptr) { return false; } - imageMicrophone->SetPosition(IMAGE_AGREEING_POSITION_X, IMAGE_ALL_POSITION_Y); // 30 : offset - imageMicrophone->SetSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH); + imageMicrophone->SetPosition(46, 207); // 30 : offset + imageMicrophone->SetSrc(PNG_230_MICROPHONE_OPEN_IMAGE_PATH); imageMicrophone->SetTouchable(true); imageMicrophone->SetViewId("microphoneChange"); + group->Add(imageMicrophone); imageHandUp = new UIImageView(); if (imageHandUp == nullptr) { return false; } - imageHandUp->SetPosition(IMAGE_DISSGREE_POSITION_X, IMAGE_ALL_POSITION_Y); // 30 : offset - imageHandUp->SetSrc(PNG_DISSGREE_IMAGE_PATH); + imageHandUp->SetPosition(188, 340); // 30 : offset + imageHandUp->SetSrc(PNG_230_VECTOR_IMAGE_PATH); imageHandUp->SetTouchable(true); imageHandUp->SetViewId("callingHandUp"); group->Add(imageHandUp); @@ -122,12 +149,43 @@ bool CallingView::InitImageViewDisplay() if (imageHorns == nullptr) { return false; } - imageHorns->SetPosition(IMAGE_HONRS_POSITION_X, IMAGE_HONRS_POSITION_Y); // 30 : offset - imageHorns->SetSrc(PNG_SOUNDBUTTON2); + imageHorns->SetPosition(369, 207); // 30 : offset + imageHorns->SetSrc(PNG_230_VOICE_OPEN_IMAGE_PATH); imageHorns->SetTouchable(true); imageHorns->SetViewId("volumeSwitch"); - - group->Add(imageHorns); + group->Add(imageHorns); + + imagedial = new UIImageView(); + if (imagedial == nullptr) { + return false; + } + imagedial->SetPosition(80, 296); // 30 : offset + imagedial->SetSrc(PNG_230_DIAL_IMAGE_PATH); + imagedial->SetTouchable(true); + imagedial->SetViewId("dial"); + group->Add(imagedial); + + + imageheadset = new UIImageView(); + if (imagedial == nullptr) { + return false; + } + imageheadset->SetPosition(296, 296); // 30 : offset + imageheadset->SetSrc(PNG_230_HEADSET_1_IIMAGE_PATH); + imageheadset->SetTouchable(true); + imageheadset->SetViewId("headset"); + group->Add(imageheadset); + + imageperson = new UIImageView(); + if (imagedial == nullptr) { + return false; + } + imageperson->SetPosition(158, 158); // 30 : offset + imageperson->SetSrc(PNG_230_PERSON_IMAGE_PATH); + imageperson->SetTouchable(true); + imageperson->SetViewId("headset"); + group->Add(imageperson); + return true; } @@ -147,42 +205,164 @@ bool CallingView::InitUILabelDisplay() if (callerDisplay == nullptr) { return false; } - callerDisplay->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y, - VIEW_DISTANCE_TO_LEFT_SIDE, TITLE_LABEL_DEFAULT_HEIGHT); + callerDisplay->SetPosition(88, 81, + 289, 40); callerDisplay->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER); callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_DISPLAY_FONE_SIZE); callerDisplay->SetTextColor(Color::White()); + callerDisplay->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); group->Add(callerDisplay); callDuration = new UILabel(); if (callDuration == nullptr) { return false; } - callDuration->SetPosition(LABEL_CALLERD_POSITION_X, LABEL_CALLERD_POSITION_Y, - VIEW_DISTANCE_TO_LEFT_SIDE, TITLE_LABEL_DEFAULT_HEIGHT); + callDuration->SetPosition(194, 38, + 79, 35); callDuration->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); callDuration->SetAlign(TEXT_ALIGNMENT_CENTER); callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); - callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_TIME_FONT_SIZE); - callDuration->SetTextColor(Color::White()); + callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + callDuration->SetTextColor(Color::GetColorFromRGBA(0xaa, 0xaa, 0xaa, 0xff)); group->Add(callDuration); - currentTimes = new UILabel(); - if (currentTimes == nullptr) { + + // currentTimes = new UILabel(); + // if (currentTimes == nullptr) { + // return false; + // } + // currentTimes->SetPosition(LABEL_CURREMTTIME_POSITION_X, LABEL_CURREMTTIME_POSITION_Y, + // VIEW_DISTANCE_TO_LEFT_SIDE, TITLE_LABEL_DEFAULT_HEIGHT); + // currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + // currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER); + // currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); + // currentTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_TIME_FONT_SIZE); + // currentTimes->SetTextColor(Color::White()); + + // group->Add(currentTimes); + return true; +} + +static char *dial_id_str[]={"1","2","3","4","5","6","7","8","9","*","0","#"}; +void CallingView::showdial(bool flag) +{ + if(flag) + { + label_number->SetText(""); + dial_group->SetVisible(true); + } + else + { + dial_group->SetVisible(false); + } + return; +} + +void CallingView::text_updata_buf(const char *buf) +{ + uapi_hfp_send_DTMF_CODE(buf[0]); + char new_buf[16]={0}; + const char*text_buf=label_number->GetText(); + sprintf_s(new_buf,16,"%s%s",text_buf,buf); + label_number->SetText(new_buf); + RootView::GetInstance()->Invalidate(); + + return; +} + + +bool CallingView::Initshowdial() +{ + dial_group = new UIViewGroup(); + if (dial_group == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::UIViewGroup::new group error"); + return false; + } + dial_group->SetPosition(MATH_ZERO, MATH_ZERO); + dial_group->Resize(466, 466); // 454 : value + dial_group->SetViewId("dialing"); + dial_group->SetTouchable(true); + dial_group->SetDraggable(true); + + dragListener = (UIView::OnDragListener*)OHOS::MainCallingPresenter::GetInstance(); + if (dragListener == nullptr) { + return false; } - currentTimes->SetPosition(LABEL_CURREMTTIME_POSITION_X, LABEL_CURREMTTIME_POSITION_Y, - VIEW_DISTANCE_TO_LEFT_SIDE, TITLE_LABEL_DEFAULT_HEIGHT); - currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER); - currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); - currentTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_TIME_FONT_SIZE); - currentTimes->SetTextColor(Color::White()); + dial_group->SetOnDragListener(dragListener); + + uint8_t showdial_i=0; + for(int i=0;i<4;i++) + { + for(int j=0;j<3;j++) + { + if (labelButton[showdial_i] == nullptr) { + labelButton[showdial_i] = new UILabelButton(); + } + if(labelButton[showdial_i]==nullptr) + { + return false; + } + labelButton[showdial_i]->SetPosition(69+(j*111), 107+(i*78)); // widget's left position and top position + + labelButton[showdial_i]->Resize(107, 70); // widget's width and height + labelButton[showdial_i]->SetViewId(dial_id_str[showdial_i]);// Set style + labelButton[showdial_i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + + labelButton[showdial_i]->SetText(dial_id_str[showdial_i]); + labelButton[showdial_i]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); + labelButton[showdial_i]->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + dial_group->Add(labelButton[showdial_i]); + labelButton[showdial_i]->SetVisible(true); + showdial_i++; + } + } - group->Add(currentTimes); + if (image_line == nullptr) { + image_line = new UIImageView(); + } + if(image_line == nullptr) + { + return false; + } + image_line->SetPosition(193, 25); // widget's left position and top position + image_line->Resize(80, 8); // widget's width and height + image_line->SetViewId("image1");// Set style + image_line->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + image_line->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + image_line->SetStyle(STYLE_BORDER_RADIUS, 100); + + dial_group->Add(image_line); + image_line->SetVisible(true); + + // Add Label to App + if (label_number == nullptr) { + label_number = new UILabel(); + } + if(label_number == nullptr) + { + return false; + } + label_number->SetPosition(100, 43); // widget's left position and top position + label_number->Resize(265, 60); // widget's width and height + label_number->SetViewId("label3");// Set style + label_number->SetStyle(STYLE_TEXT_FONT, 40); + + // Set additional property + label_number->SetText(""); + label_number->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); + label_number->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label_number->SetRollSpeed(0); + label_number->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); + dial_group->Add(label_number); + + group->Add(dial_group); + dial_group->SetVisible(false); return true; + } UIViewGroup *CallingView::CreateUIViewGroup() @@ -199,16 +379,23 @@ UIViewGroup *CallingView::CreateUIViewGroup() WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitImageViewDisplay error"); return nullptr; } - - if (!InitAddOnclickevent()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitAddOnclickevent error"); + if (!InitUILabelDisplay()) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitUILabelDisplay error"); return nullptr; } - if (!InitUILabelDisplay()) { + if(!Initshowdial()) + { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitUILabelDisplay error"); return nullptr; } + if (!InitAddOnclickevent()) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitAddOnclickevent error"); + return nullptr; + } + + + return group; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp index 85ecc6940..ce7dcf12d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp @@ -188,11 +188,11 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) if (strcmp(view.GetViewId(), "microphoneChange") == 0) { if (changeImage == 0) { changeImage = 1; - view_->GetCallingView()->GetImageMicrophone()->SetSrc(PNG_MICROPHONE_CLOSE_IMAGE_PATH); + view_->GetCallingView()->GetImageMicrophone()->SetSrc(PNG_230_MICROPHONE_CLOSE_IMAGE_PATH); SetMicMute(true); } else { changeImage = 0; - view_->GetCallingView()->GetImageMicrophone()->SetSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH); + view_->GetCallingView()->GetImageMicrophone()->SetSrc(PNG_230_MICROPHONE_OPEN_IMAGE_PATH); SetMicMute(false); } return true; @@ -228,6 +228,72 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) } return true; } + else if ((strcmp(view.GetViewId(), "dial") == 0)) + { + CallingView::GetInstance()->showdial(true); + } + + if (strcmp(view.GetViewId(), "0") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "1") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "2") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "3") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "4") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "5") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "6") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "7") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "8") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + else if (strcmp(view.GetViewId(), "9") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + }else if (strcmp(view.GetViewId(), "*") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); /* code */ + } + else if (strcmp(view.GetViewId(), "#") == 0) + { + CallingView::GetInstance()->text_updata_buf(view.GetViewId()); + } + + + return true; +} + +bool MainCallingPresenter::OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) +{ + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter OnDragEnd"); + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) + { + if((strcmp(view.GetViewId(), "dialing") == 0)) + CallingView::GetInstance()->showdial(false); + } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallView.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallView.cpp index 331f000df..d4f0b7091 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallView.cpp @@ -56,7 +56,7 @@ namespace OHOS button->SetImageSrc(defaultImgSrc, triggeredImgSrc); button->SetStyleForState(STYLE_BORDER_COLOR, 0xff191919, UIButton::PRESSED); button->SetStyleForState(STYLE_BORDER_WIDTH, 0, UIButton::PRESSED); - button->SetStyleForState(STYLE_BORDER_COLOR, 0xff191919, UIButton::PRESSED); + //button->SetStyleForState(STYLE_BORDER_COLOR, 0xff191919, UIButton::PRESSED); // Add the callback for events UIView::OnClickListener *buttonClick = static_cast(PhoneCallPresenter::GetInstance()); button->SetOnClickListener(buttonClick); diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp index 5ab5893cb..c567c030e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp @@ -377,17 +377,17 @@ namespace OHOS if (label1_ == nullptr) { label1_ = new UILabel(); } - label1_->SetPosition(158, 18); // widget's left position and top position - label1_->Resize(800, 88); // widget's width and height + label1_->SetPosition(0, 18); // widget's left position and top position + label1_->Resize(466, 88); // widget's width and height label1_->SetViewId("label1");// Set style - label1_->SetStyle(STYLE_TEXT_FONT, 50); + label1_->SetStyle(STYLE_TEXT_FONT, 30); - label1_->SetText("通讯录"); - label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label1_->SetTextColor(Color::GetColorFromRGBA(0xac, 0xa4, 0xa4, 0xff)); + label1_->SetText("常用联系人"); + label1_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + //label1_->SetTextColor(Color::GetColorFromRGBA(0xac, 0xa4, 0xa4, 0xff)); label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); label1_->SetRollSpeed(0); - label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 50); + label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); container_->Add(label1_); if(addressbook_t.num<=0 ||addressbook_t.num>20) diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h index 5cb511dd1..08c14fec4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h @@ -262,6 +262,8 @@ int uapi_hfp_connect(void); int uapi_hfp_connect_state(void); +void uapi_hfp_send_DTMF_CODE(char code); + #ifdef __cplusplus } #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index 0f65679e0..b2c9675f9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -1909,6 +1909,14 @@ int uapi_hfp_connect_state(void) } +void uapi_hfp_send_DTMF_CODE(char code) +{ + bd_addr_t bdaddr={0}; + get_phone_addr(&bdaddr); + int ret= hfp_hf_send_dtmf_tone(&bdaddr,code); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[hfp_hf_send_dtmf_tone] ret:%d", ret); +} + #ifdef __cplusplus } #endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp index 544d77562..e484714ee 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp @@ -228,6 +228,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) } return true; } + return true; } diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/Ellipse 4.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/Ellipse 4.bin new file mode 100644 index 000000000..219c8d709 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/Ellipse 4.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:288c01fbc20c96cbf6adf3eaeff643eba6ffae7d500ae04e6d63e9c504c1d0c7 +size 40 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/dial.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/dial.bin new file mode 100644 index 000000000..6f5b5ba11 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/dial.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bf7ea2a50a4ac6f3c9be83393fe80aa5e1a380921bfc6da1844b0602984e4d8 +size 5544 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_1.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_1.bin new file mode 100644 index 000000000..6c6275884 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a06acfa32e465f2d873648d5309bf898a25e913992d93fd396264dfcbdaf0a5 +size 5544 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_2.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_2.bin new file mode 100644 index 000000000..5fd752743 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/headset_2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f921f831c124c5460fc9f6641fe5e93606474ca724e59b72783900dd1d723bd +size 5544 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone.bin new file mode 100644 index 000000000..231def522 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aec3a2c3fc984dbfeb80f136d895701eb00632c7b6b4ccbe00e8834c197d4e3c +size 1896 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone_1.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone_1.bin new file mode 100644 index 000000000..b153d9fc4 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/microphone_1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98d50e4aca9aa85a118bb57caebdd57accdf45c4f44450e4adedd24d301d64f6 +size 1896 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/person.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/person.bin new file mode 100644 index 000000000..00202de2f --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/person.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:330e5705f57b8120f271eae93d31e2b02bbe0624f34e3c6fc83024f14b94e27b +size 15224 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/vector.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/vector.bin new file mode 100644 index 000000000..7de1612ad --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/vector.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:115a3276956e3761da338e9b6fc315644dd28cbd70de4b86d1a82d8ef36e124f +size 5544 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/voice.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/voice.bin new file mode 100644 index 000000000..aad479e62 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/makephone/voice.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:083d65699e9b191705b8de99dc5f72aad6ffcd221247e82e480d17cdb18ce2be +size 1896 -- 2.17.1