!48131 root scene中提供获取避让区域的能力

Merge pull request !48131 from ReCoder/root_scene_avoid_area
This commit is contained in:
openharmony_ci 2024-11-11 13:22:07 +00:00 committed by Gitee
commit a198bf5f7f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 0 additions and 35 deletions

View File

@ -30,8 +30,6 @@
#include "ui_extension_context.h"
#include "window_manager.h"
#include "wm/wm_common.h"
#include "root_scene.h"
#include "ws_common.h"
#include "adapter/ohos/entrance/ace_application_info.h"
#include "adapter/ohos/entrance/ace_view_ohos.h"
@ -2379,28 +2377,6 @@ NG::SafeAreaInsets AceContainer::GetViewSafeAreaByType(OHOS::Rosen::AvoidAreaTyp
return {};
}
Rect AceContainer::GetSessionAvoidAreaByType(uint32_t safeAreaType)
{
Rosen::WSRect avoidArea;
Rect sessionAvoidArea;
if (safeAreaType == NG::SAFE_AREA_TYPE_SYSTEM) {
auto ret =
Rosen::RootScene::staticRootScene_->GetSessionRectByType(Rosen::AvoidAreaType::TYPE_SYSTEM, avoidArea);
if (ret == Rosen::WMError::WM_OK) {
sessionAvoidArea.SetRect(avoidArea.posX_, avoidArea.posY_, avoidArea.width_, avoidArea.height_);
}
} else if (safeAreaType == NG::SAFE_AREA_TYPE_KEYBOARD) {
auto ret =
Rosen::RootScene::staticRootScene_->GetSessionRectByType(Rosen::AvoidAreaType::TYPE_KEYBOARD, avoidArea);
if (ret == Rosen::WMError::WM_OK) {
sessionAvoidArea.SetRect(avoidArea.posX_, avoidArea.posY_, avoidArea.width_, avoidArea.height_);
}
}
LOGI("GetSessionAvoidAreaByType safeAreaType: %{public}u, sessionAvoidArea; %{public}s", safeAreaType,
sessionAvoidArea.ToString().c_str());
return sessionAvoidArea;
}
NG::SafeAreaInsets AceContainer::GetKeyboardSafeArea()
{
CHECK_NULL_RETURN(uiWindow_, {});

View File

@ -560,8 +560,6 @@ public:
NG::SafeAreaInsets GetKeyboardSafeArea() override;
Rect GetSessionAvoidAreaByType(uint32_t safeAreaType) override;
Rosen::AvoidArea GetAvoidAreaByType(Rosen::AvoidAreaType type);
// ArkTSCard

View File

@ -201,11 +201,6 @@ public:
return {};
}
virtual Rect GetSessionAvoidAreaByType(uint32_t safeAreaType)
{
return {};
}
virtual std::string GetHapPath() const
{
return {};

View File

@ -139,10 +139,6 @@ NG::SafeAreaInsets AceContainer::GetKeyboardSafeArea()
return {};
}
Rect AceContainer::GetSessionAvoidAreaByType(uint32_t safeAreaType)
{
return {};
}
bool AceContainer::IsLauncherContainer()
{
return true;