makephone 文件夹更新
authorluozheng <1732036298@qq.com>
Wed, 29 May 2024 04:45:12 +0000 (12:45 +0800)
committerluozheng <1732036298@qq.com>
Wed, 29 May 2024 04:45:12 +0000 (12:45 +0800)
code/sdk/application/wearable/fd230app/nativeui/makephone/include/MainCallingPresenter.h
code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/DialingScreenView.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingView.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp

index 28739ff..9973279 100644 (file)
@@ -19,7 +19,7 @@ class MainCallingView;
 class MainCallingPresenter : public Presenter<MainCallingView>, public UIView::OnClickListener {
 public:
     MainCallingPresenter();
-    virtual ~MainCallingPresenter();
+    ~MainCallingPresenter() override;
 
     void OnStart() override;
     void OnPause() override;
@@ -31,12 +31,13 @@ public:
     bool CallingViewDisplay();
     bool InitPointerValue();
     bool OnClick(UIView& view, const ClickEvent& event) override;
+    VolumeSettingView *GetvolumeSetting();
 private:
     int changeImage{0};
     bool HintsHandupClick();
     KeyInputListener *keyActListenr{nullptr};
     VolumeSettingView *volumeSetting{nullptr};
-    UIViewGroup *volumeSettingView{nullptr};
+    
 };
 }
 
index 86620c0..7c14e31 100644 (file)
@@ -139,17 +139,17 @@ UIViewGroup *CallerDisplayView::CreateUIViewGroup()
     group->SetPosition(MATH_ZERO, MATH_ZERO);
     group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value
 
-    if (InitImageViewDisplay() == false) {
+    if (!InitImageViewDisplay()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerDisplayView::InitImageViewDisplay error");
         return nullptr;
     }
 
-    if (InitAddOnclickevent() == false) {
+    if (!InitAddOnclickevent()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerDisplayView::InitAddOnclickevent error");
         return nullptr;
     }
 
-    if (InitUILabelDisplay() == false) {
+    if (!InitUILabelDisplay()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerDisplayView::InitUILabelDisplay error");
         return nullptr;
     }
index e487b16..3034ea7 100644 (file)
@@ -164,7 +164,7 @@ bool CallingView::InitUILabelDisplay()
         VIEW_DISTANCE_TO_LEFT_SIDE, TITLE_LABEL_DEFAULT_HEIGHT);
     callDuration->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
     callDuration->SetAlign(TEXT_ALIGNMENT_CENTER);
-    callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration());
+    callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str());
     callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_TIME_FONT_SIZE);
     callDuration->SetTextColor(Color::White());
     group->Add(callDuration);
@@ -195,17 +195,17 @@ UIViewGroup *CallingView::CreateUIViewGroup()
     group->SetPosition(MATH_ZERO, MATH_ZERO);
     group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value
 
-    if (InitImageViewDisplay() == false) {
+    if (!InitImageViewDisplay()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitImageViewDisplay error");
         return nullptr;
     }
 
-    if (InitAddOnclickevent() == false) {
+    if (!InitAddOnclickevent()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitAddOnclickevent error");
         return nullptr;
     }
 
-    if (InitUILabelDisplay() == false) {
+    if (!InitUILabelDisplay()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitUILabelDisplay error");
         return nullptr;
     }
index 2ad9945..f9b20d5 100644 (file)
@@ -124,7 +124,7 @@ UIViewGroup *DialingScreenView::CreateUIViewGroup()
     group->SetPosition(MATH_ZERO, MATH_ZERO);
     group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value
 
-    if (InitUILabelDisplay() == false) {
+    if (!InitUILabelDisplay()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialingScreenView::InitImageViewDisplay error");
         return nullptr;
     }
index 1f8a2e7..85ecc69 100644 (file)
@@ -30,9 +30,8 @@ MainCallingPresenter::~MainCallingPresenter()
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::~MainCallingPresenter");
     RootView::GetInstance()->RemoveAll();
-    if (volumeSettingView != nullptr) {
-        delete volumeSettingView;
-        volumeSettingView = nullptr;
+    if (volumeSetting != nullptr) {
+        delete volumeSetting;
         volumeSetting = nullptr;
     }
     g_pMainView = nullptr;
@@ -70,13 +69,13 @@ void MainCallingPresenter::OnStop(void)
 
 void MainCallingPresenter::HonrsViewChange()
 {
-    if (volumeSettingView == nullptr) {
+    if (volumeSetting == nullptr) {
         volumeSetting = new VolumeSettingView();
         if (volumeSetting == nullptr) {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::volumeSetting nullptr err");
             return;
         }
-        if (volumeSetting->SetUpVolume() == false) {
+        if (!volumeSetting->SetUpVolume()) {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::volumeSetting SetUpVolume fail");
             return;
         }
@@ -85,10 +84,9 @@ void MainCallingPresenter::HonrsViewChange()
             ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES);
             volumeSetting->GetDecreaseButton()->SetImageSrc(image, image);
         }
-        volumeSettingView = volumeSetting;
-        RootView::GetInstance()->Add(volumeSettingView);
+        RootView::GetInstance()->Add(volumeSetting);
     }
-    VolumeSliderEventListener *volumeSliderEventListener = VolumeSliderEventListener::GetInstance();
+    VolumeSliderEventListener *volumeSliderEventListener = volumeSetting->GetVolumeEventListener();
     if (volumeSliderEventListener == nullptr) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::volumeSliderEventListener nullptr err");
         return;
@@ -96,7 +94,7 @@ void MainCallingPresenter::HonrsViewChange()
 
     volumeSliderEventListener->SetPlayerCoefficients(VOLUMEPHONE); // 进度条系数
 
-    if (InitPointerValue() == false) {
+    if (!InitPointerValue()) {
         return;
     }
 
@@ -105,14 +103,14 @@ void MainCallingPresenter::HonrsViewChange()
     view_->GetCallingGroup()->SetVisible(false);
     view_->GetWaitingGroup()->SetVisible(false);
 
-    volumeSettingView->SetVisible(true);
+    volumeSetting->SetVisible(true);
     // 刷新UI
     RootView::GetInstance()->Invalidate();
 }
 
 bool MainCallingPresenter::CallingViewDisplay()
 {
-    if (InitPointerValue() == false) {
+    if (!InitPointerValue()) {
         return false;
     }
     view_->GetScreenGroup()->SetVisible(false);
@@ -174,7 +172,7 @@ bool MainCallingPresenter::HintsHandupClick()
     }
     CallerLogModel::GetInstance()->SetWaitingStatus(false);
     CallerLogModel::GetInstance()->SetCallStatus(true);
-    NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, TransitionType::TRANSITION_ZOOM ,PRIORITY_ONE);
+    NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, TransitionType::TRANSITION_INVALID, PRIORITY_ONE);
     return true;
 }
 
@@ -182,7 +180,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
 {
     UNUSED(event);
 
-    if (InitPointerValue() == false) {
+    if (!InitPointerValue()) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::InitPointerValue error");
         return false;
     }
@@ -216,7 +214,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::honrs show");
         HonrsViewChange();
     } else if (strcmp(view.GetViewId(), "hintsHandup") == 0) {
-        if (HintsHandupClick() == false) {
+        if (!HintsHandupClick()) {
             return false;
         }
     } else if (strcmp(view.GetViewId(), "answer") == 0) {
@@ -232,4 +230,9 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
     }
     return true;
 }
+
+VolumeSettingView *MainCallingPresenter::GetvolumeSetting()
+{
+    return volumeSetting;
+}
 }
\ No newline at end of file
index c2cc247..36031b7 100644 (file)
@@ -132,15 +132,15 @@ void MainCallingView::OnStart()
 
     waitingGroup->SetVisible(false);
     callingGroup->SetVisible(false);
-    if (CallerLogModel::GetInstance()->GetCallStatus() == true) {
+    if (CallerLogModel::GetInstance()->GetCallStatus()) {
         displayGroup->SetVisible(false);
         callingGroup->SetVisible(true);
         screenGroup->SetVisible(false);
-    } else if (CallerLogModel::GetInstance()->GetWaitingStatus() == true) {
+    } else if (CallerLogModel::GetInstance()->GetWaitingStatus()) {
         screenGroup->SetVisible(false);
         displayGroup->SetVisible(false);
         waitingGroup->SetVisible(true);
-    } else if (CallerLogModel::GetInstance()->GetPhoneStatus() == true) {
+    } else if (CallerLogModel::GetInstance()->GetPhoneStatus()) {
         displayGroup->SetVisible(false);
     } else {
         screenGroup->SetVisible(false);
@@ -153,7 +153,7 @@ void MainCallingView::OnSetUpView()
 {
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingView::~OnSetUpView");
     View<MainCallingPresenter>::OnSetUpView();
-    if (CallerLogModel::GetInstance()->GetMulitplePhoneStatus() == true) {
+    if (CallerLogModel::GetInstance()->GetMulitplePhoneStatus()) {
         MulitplePhoneTextReplaces();
         CallerLogModel::GetInstance()->SetMulitplePhoneStatus(false);
     }
index 7d810f4..6a41adb 100644 (file)
@@ -50,10 +50,10 @@ UIViewGroup *WaitingHintsView::CreateUIViewGroup()
     group->SetPosition(MATH_ZERO, MATH_ZERO);
     group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value
 
-    if (InitImageViewDisplay() == false) {
+    if (!InitImageViewDisplay()) {
         return nullptr;
     }
-    if (InitUILabelDisplay() == false) {
+    if (!InitUILabelDisplay()) {
         return nullptr;
     }
     return group;