!39960 解决联系人键盘收起crash问题

Merge pull request !39960 from 冯纪拓/uint32_t
This commit is contained in:
openharmony_ci 2024-08-08 15:25:45 +00:00 committed by Gitee
commit 65e483bc09
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 12 additions and 13 deletions

View File

@ -70,7 +70,7 @@ bool SafeAreaManager::UpdateNavArea(const SafeAreaInsets& safeArea)
return true;
}
bool SafeAreaManager::UpdateKeyboardSafeArea(uint32_t keyboardHeight, std::optional<uint32_t> rootHeight)
bool SafeAreaManager::UpdateKeyboardSafeArea(float keyboardHeight, std::optional<uint32_t> rootHeight)
{
uint32_t bottom;
if (systemSafeArea_.bottom_.IsValid()) {

View File

@ -97,7 +97,7 @@ public:
* @param keyboardHeight The height of the keyboard in pixels.
* @return true if the safe area was modified, false otherwise.
*/
bool UpdateKeyboardSafeArea(uint32_t keyboardHeight, std::optional<uint32_t> rootHeight = std::nullopt);
bool UpdateKeyboardSafeArea(float keyboardHeight, std::optional<uint32_t> rootHeight = std::nullopt);
/**
* @brief Retrieves the inset of the safe area caused by the keyboard.

View File

@ -751,7 +751,7 @@ void PipelineBase::OnVirtualKeyboardAreaChange(Rect keyboardArea, double positio
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction, bool forceChange)
{
auto currentContainer = Container::Current();
auto keyboardHeight = static_cast<uint32_t>(keyboardArea.Height());
float keyboardHeight = keyboardArea.Height();
if (currentContainer && !currentContainer->IsSubContainer()) {
auto subwindow = SubwindowManager::GetInstance()->GetSubwindow(currentContainer->GetInstanceId());
if (subwindow && subwindow->GetShown() && subwindow->IsFocused() && !CheckNeedAvoidInSubWindow()) {
@ -762,7 +762,6 @@ void PipelineBase::OnVirtualKeyboardAreaChange(Rect keyboardArea, double positio
}
}
if (NotifyVirtualKeyBoard(rootWidth_, rootHeight_, keyboardHeight)) {
CheckAndUpdateKeyboardInset(keyboardHeight);
return;
}
OnVirtualKeyboardHeightChange(keyboardHeight, positionY, height, rsTransaction, forceChange);

View File

@ -356,7 +356,7 @@ public:
virtual void GetBoundingRectData(int32_t nodeId, Rect& rect) {}
virtual void CheckAndUpdateKeyboardInset(uint32_t keyboardHeight) {}
virtual void CheckAndUpdateKeyboardInset(float keyboardHeight) {}
virtual RefPtr<AccessibilityManager> GetAccessibilityManager() const;
@ -1347,7 +1347,7 @@ protected:
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr, const float safeHeight = 0.0f,
const bool supportAvoidance = false, bool forceChange = false)
{}
virtual void OnVirtualKeyboardHeightChange(uint32_t keyboardHeight, double positionY, double height,
virtual void OnVirtualKeyboardHeightChange(float keyboardHeight, double positionY, double height,
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr, bool forceChange = false)
{}

View File

@ -1457,7 +1457,7 @@ void PipelineContext::UpdateNavSafeArea(const SafeAreaInsets& navSafeArea)
}
}
void PipelineContext::CheckAndUpdateKeyboardInset(uint32_t keyboardHeight)
void PipelineContext::CheckAndUpdateKeyboardInset(float keyboardHeight)
{
safeAreaManager_->UpdateKeyboardSafeArea(keyboardHeight);
}
@ -1749,7 +1749,7 @@ void PipelineContext::OriginalAvoidanceLogic(
DoKeyboardAvoidAnimate(keyboardAnimationConfig_, keyboardHeight, func);
}
void PipelineContext::OnVirtualKeyboardHeightChange(uint32_t keyboardHeight, double positionY, double height,
void PipelineContext::OnVirtualKeyboardHeightChange(float keyboardHeight, double positionY, double height,
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction, bool forceChange)
{
CHECK_RUN_ON(UI);
@ -1845,7 +1845,7 @@ void PipelineContext::OnVirtualKeyboardHeightChange(uint32_t keyboardHeight, dou
}
TAG_LOGI(AceLogTag::ACE_KEYBOARD,
"keyboardHeight: %{public}d, positionY: %{public}f, textHeight: %{public}f, "
"keyboardHeight: %{public}f, positionY: %{public}f, textHeight: %{public}f, "
"rootSize.Height() %{public}f final calculate keyboard offset is %{public}f",
keyboardHeight, positionY, height, rootSize.Height(), context->safeAreaManager_->GetKeyboardOffset());
context->SyncSafeArea(SafeAreaSyncType::SYNC_TYPE_KEYBOARD);

View File

@ -303,7 +303,7 @@ public:
bool CheckNeedAvoidInSubWindow() override;
void CheckAndUpdateKeyboardInset(uint32_t keyboardHeight) override;
void CheckAndUpdateKeyboardInset(float keyboardHeight) override;
void UpdateSizeChangeReason(
WindowSizeChangeReason type, const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr);
@ -866,7 +866,7 @@ protected:
void OnVirtualKeyboardHeightChange(float keyboardHeight,
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr, const float safeHeight = 0.0f,
const bool supportAvoidance = false, bool forceChange = false) override;
void OnVirtualKeyboardHeightChange(uint32_t keyboardHeight, double positionY, double height,
void OnVirtualKeyboardHeightChange(float keyboardHeight, double positionY, double height,
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr, bool forceChange = false) override;
void SetIsLayouting(bool layouting)

View File

@ -325,7 +325,7 @@ void PipelineContext::OnVirtualKeyboardHeightChange(float keyboardHeight,
const bool supportAvoidance, bool forceChange)
{}
void PipelineContext::OnVirtualKeyboardHeightChange(uint32_t keyboardHeight, double positionY, double height,
void PipelineContext::OnVirtualKeyboardHeightChange(float keyboardHeight, double positionY, double height,
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction, bool forceChange)
{}
@ -643,7 +643,7 @@ void PipelineContext::ResetDragging() {}
void PipelineContext::UpdateOriginAvoidArea(const Rosen::AvoidArea& avoidArea, uint32_t type) {}
void PipelineContext::CheckAndUpdateKeyboardInset(uint32_t keyboardHeight) {}
void PipelineContext::CheckAndUpdateKeyboardInset(float keyboardHeight) {}
bool PipelineContext::PrintVsyncInfoIfNeed() const
{