mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
bugfix
Signed-off-by: luoying_ace_admin <luoying19@huawei.com> Change-Id: Ie68ae87223e40cb51abd9cda975b5aec419927a1
This commit is contained in:
parent
8699ca7261
commit
412e5e5beb
@ -713,6 +713,12 @@ public:
|
|||||||
void FireUIExtensionEventCallback(uint32_t eventId);
|
void FireUIExtensionEventCallback(uint32_t eventId);
|
||||||
void FireAccessibilityEventCallback(uint32_t eventId, int64_t parameter);
|
void FireAccessibilityEventCallback(uint32_t eventId, int64_t parameter);
|
||||||
|
|
||||||
|
bool IsFloatingWindow() const override
|
||||||
|
{
|
||||||
|
CHECK_NULL_RETURN(uiWindow_, false);
|
||||||
|
return uiWindow_->GetMode() == Rosen::WindowMode::WINDOW_MODE_FLOATING;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool MaybeRelease() override;
|
virtual bool MaybeRelease() override;
|
||||||
void InitializeFrontend();
|
void InitializeFrontend();
|
||||||
|
@ -414,6 +414,24 @@ NG::RectF SubwindowOhos::GetRect()
|
|||||||
return windowRect_;
|
return windowRect_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SubwindowOhos::ResizeDialogSubwindow()
|
||||||
|
{
|
||||||
|
auto defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplay();
|
||||||
|
CHECK_NULL_VOID(defaultDisplay);
|
||||||
|
if (!(NearEqual(defaultDisplay->GetWidth(), window_->GetRect().width_) &&
|
||||||
|
NearEqual(defaultDisplay->GetHeight(), window_->GetRect().height_))) {
|
||||||
|
auto container = Container::Current();
|
||||||
|
CHECK_NULL_VOID(container);
|
||||||
|
auto taskExecutor = container->GetTaskExecutor();
|
||||||
|
CHECK_NULL_VOID(taskExecutor);
|
||||||
|
taskExecutor->PostTask(
|
||||||
|
[this]() {
|
||||||
|
ResizeWindow();
|
||||||
|
},
|
||||||
|
TaskExecutor::TaskType::UI, "ArkUIResizeDialogSubwindow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SubwindowOhos::ShowPopup(const RefPtr<Component>& newComponent, bool disableTouchEvent)
|
void SubwindowOhos::ShowPopup(const RefPtr<Component>& newComponent, bool disableTouchEvent)
|
||||||
{
|
{
|
||||||
TAG_LOGD(AceLogTag::ACE_SUB_WINDOW, "show popup enter");
|
TAG_LOGD(AceLogTag::ACE_SUB_WINDOW, "show popup enter");
|
||||||
|
@ -159,6 +159,8 @@ public:
|
|||||||
bool IsToastSubWindow() override;
|
bool IsToastSubWindow() override;
|
||||||
void DestroyWindow() override;
|
void DestroyWindow() override;
|
||||||
|
|
||||||
|
void ResizeDialogSubwindow() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RefPtr<StackElement> GetStack();
|
RefPtr<StackElement> GetStack();
|
||||||
void AddMenu(const RefPtr<Component>& newComponent);
|
void AddMenu(const RefPtr<Component>& newComponent);
|
||||||
|
@ -186,6 +186,8 @@ public:
|
|||||||
virtual bool Close() = 0;
|
virtual bool Close() = 0;
|
||||||
virtual bool IsToastSubWindow() = 0;
|
virtual bool IsToastSubWindow() = 0;
|
||||||
virtual void DestroyWindow() = 0;
|
virtual void DestroyWindow() = 0;
|
||||||
|
virtual void ResizeDialogSubwindow() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32_t subwindowId_ = 0;
|
int32_t subwindowId_ = 0;
|
||||||
int32_t uiExtensionHostWindowId_ = 0;
|
int32_t uiExtensionHostWindowId_ = 0;
|
||||||
|
@ -617,6 +617,12 @@ public:
|
|||||||
{
|
{
|
||||||
return Rect();
|
return Rect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool IsFloatingWindow() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool IsFontFileExistInPath(const std::string& path);
|
bool IsFontFileExistInPath(const std::string& path);
|
||||||
std::string GetFontFamilyName(std::string path);
|
std::string GetFontFamilyName(std::string path);
|
||||||
|
@ -86,6 +86,8 @@ void DialogLayoutAlgorithm::Measure(LayoutWrapper* layoutWrapper)
|
|||||||
dialogPattern->UpdateDeviceOrientation(SystemProperties::GetDeviceOrientation());
|
dialogPattern->UpdateDeviceOrientation(SystemProperties::GetDeviceOrientation());
|
||||||
}
|
}
|
||||||
UpdateSafeArea();
|
UpdateSafeArea();
|
||||||
|
isShowInFloatingWindow_ = dialogPattern->IsShowInFloatingWindow();
|
||||||
|
ResizeDialogSubwindow(expandDisplay_, isShowInSubWindow_, isShowInFloatingWindow_);
|
||||||
const auto& layoutConstraint = dialogProp->GetLayoutConstraint();
|
const auto& layoutConstraint = dialogProp->GetLayoutConstraint();
|
||||||
const auto& parentIdealSize = layoutConstraint->parentIdealSize;
|
const auto& parentIdealSize = layoutConstraint->parentIdealSize;
|
||||||
OptionalSizeF realSize;
|
OptionalSizeF realSize;
|
||||||
@ -126,6 +128,18 @@ void DialogLayoutAlgorithm::Measure(LayoutWrapper* layoutWrapper)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogLayoutAlgorithm::ResizeDialogSubwindow(
|
||||||
|
bool expandDisplay, bool isShowInSubWindow, bool isShowInFloatingWindow)
|
||||||
|
{
|
||||||
|
if (expandDisplay && isShowInSubWindow && isShowInFloatingWindow) {
|
||||||
|
auto currentId = Container::CurrentId();
|
||||||
|
auto subWindow = SubwindowManager::GetInstance()->GetSubwindow(currentId >= MIN_SUBCONTAINER_ID ?
|
||||||
|
SubwindowManager::GetInstance()->GetParentContainerId(currentId) : currentId);
|
||||||
|
CHECK_NULL_VOID(subWindow);
|
||||||
|
subWindow->ResizeDialogSubwindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DialogLayoutAlgorithm::UpdateChildMaxSizeHeight(SizeT<float>& maxSize)
|
void DialogLayoutAlgorithm::UpdateChildMaxSizeHeight(SizeT<float>& maxSize)
|
||||||
{
|
{
|
||||||
if (!isHoverMode_) {
|
if (!isHoverMode_) {
|
||||||
|
@ -96,6 +96,8 @@ private:
|
|||||||
void UpdateChildMaxSizeHeight(SizeT<float>& maxSize);
|
void UpdateChildMaxSizeHeight(SizeT<float>& maxSize);
|
||||||
void ParseSubwindowId(const RefPtr<DialogLayoutProperty>& dialogProp);
|
void ParseSubwindowId(const RefPtr<DialogLayoutProperty>& dialogProp);
|
||||||
|
|
||||||
|
void ResizeDialogSubwindow(bool expandDisplay, bool isShowInSubWindow, bool isShowInFloatingWindow);
|
||||||
|
|
||||||
RectF touchRegion_;
|
RectF touchRegion_;
|
||||||
OffsetF topLeftPoint_;
|
OffsetF topLeftPoint_;
|
||||||
bool customSize_ = false;
|
bool customSize_ = false;
|
||||||
@ -126,6 +128,8 @@ private:
|
|||||||
|
|
||||||
KeyboardAvoidMode keyboardAvoidMode_ = KeyboardAvoidMode::DEFAULT;
|
KeyboardAvoidMode keyboardAvoidMode_ = KeyboardAvoidMode::DEFAULT;
|
||||||
|
|
||||||
|
bool isShowInFloatingWindow_ = false;
|
||||||
|
|
||||||
ACE_DISALLOW_COPY_AND_MOVE(DialogLayoutAlgorithm);
|
ACE_DISALLOW_COPY_AND_MOVE(DialogLayoutAlgorithm);
|
||||||
};
|
};
|
||||||
} // namespace OHOS::Ace::NG
|
} // namespace OHOS::Ace::NG
|
||||||
|
@ -1815,6 +1815,25 @@ bool DialogPattern::IsShowInFreeMultiWindow()
|
|||||||
return container->IsFreeMultiWindow();
|
return container->IsFreeMultiWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DialogPattern::IsShowInFloatingWindow()
|
||||||
|
{
|
||||||
|
auto currentId = Container::CurrentId();
|
||||||
|
auto container = Container::Current();
|
||||||
|
if (!container) {
|
||||||
|
TAG_LOGW(AceLogTag::ACE_DIALOG, "container is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (container->IsSubContainer()) {
|
||||||
|
currentId = SubwindowManager::GetInstance()->GetParentContainerId(currentId);
|
||||||
|
container = AceEngine::Get().GetContainer(currentId);
|
||||||
|
if (!container) {
|
||||||
|
TAG_LOGW(AceLogTag::ACE_DIALOG, "parent container is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return container->IsFloatingWindow();
|
||||||
|
}
|
||||||
|
|
||||||
void DialogPattern::DumpSimplifyInfo(std::unique_ptr<JsonValue>& json)
|
void DialogPattern::DumpSimplifyInfo(std::unique_ptr<JsonValue>& json)
|
||||||
{
|
{
|
||||||
json->Put("Type", DialogTypeUtils::ConvertDialogTypeToString(dialogProperties_.type).c_str());
|
json->Put("Type", DialogTypeUtils::ConvertDialogTypeToString(dialogProperties_.type).c_str());
|
||||||
|
@ -311,6 +311,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsShowInFreeMultiWindow();
|
bool IsShowInFreeMultiWindow();
|
||||||
|
bool IsShowInFloatingWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool AvoidKeyboard() const override
|
bool AvoidKeyboard() const override
|
||||||
|
@ -99,6 +99,7 @@ public:
|
|||||||
MOCK_METHOD1(SetRect, void(const NG::RectF& rect));
|
MOCK_METHOD1(SetRect, void(const NG::RectF& rect));
|
||||||
MOCK_METHOD0(IsToastSubWindow, bool());
|
MOCK_METHOD0(IsToastSubWindow, bool());
|
||||||
MOCK_METHOD0(DestroyWindow, void());
|
MOCK_METHOD0(DestroyWindow, void());
|
||||||
|
MOCK_METHOD0(ResizeDialogSubwindow, void());
|
||||||
};
|
};
|
||||||
} // namespace OHOS::Ace
|
} // namespace OHOS::Ace
|
||||||
#endif // FOUNDATION_ACE_TEST_MOCK_BASE_MOCK_SUBWINDOW_H
|
#endif // FOUNDATION_ACE_TEST_MOCK_BASE_MOCK_SUBWINDOW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user