mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!48131 root scene中提供获取避让区域的能力
Merge pull request !48131 from ReCoder/root_scene_avoid_area
This commit is contained in:
commit
a198bf5f7f
@ -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_, {});
|
||||
|
@ -560,8 +560,6 @@ public:
|
||||
|
||||
NG::SafeAreaInsets GetKeyboardSafeArea() override;
|
||||
|
||||
Rect GetSessionAvoidAreaByType(uint32_t safeAreaType) override;
|
||||
|
||||
Rosen::AvoidArea GetAvoidAreaByType(Rosen::AvoidAreaType type);
|
||||
|
||||
// ArkTSCard
|
||||
|
@ -201,11 +201,6 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
virtual Rect GetSessionAvoidAreaByType(uint32_t safeAreaType)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
virtual std::string GetHapPath() const
|
||||
{
|
||||
return {};
|
||||
|
@ -139,10 +139,6 @@ NG::SafeAreaInsets AceContainer::GetKeyboardSafeArea()
|
||||
return {};
|
||||
}
|
||||
|
||||
Rect AceContainer::GetSessionAvoidAreaByType(uint32_t safeAreaType)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
bool AceContainer::IsLauncherContainer()
|
||||
{
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user