feat: support transparent for system app

Signed-off-by: Haryslee <lihao189@huawei.com>
This commit is contained in:
Haryslee 2024-07-22 20:18:33 +08:00
parent fa817df27b
commit dfd8a15d18
4 changed files with 19 additions and 1 deletions

View File

@ -756,4 +756,9 @@ bool SecurityComponentHandler::LoadSecurityComponentService()
{
return SecCompKit::LoadService();
}
bool SecurityComponentHandler::IsSystemAppCalling()
{
return SecCompKit::IsSystemAppCalling();
}
} // namespace OHOS::Ace::NG

View File

@ -47,6 +47,7 @@ public:
Security::SecurityComponent::OnFirstUseDialogCloseFunc&& callback);
static bool IsSecurityComponentServiceExist();
static bool LoadSecurityComponentService();
static bool IsSystemAppCalling();
private:
static bool CheckOpacity(const RefPtr<FrameNode>& node, const RefPtr<RenderContext>& renderContext);

View File

@ -25,6 +25,9 @@
#include "core/components_ng/pattern/button/button_pattern.h"
#include "core/components_ng/pattern/image/image_model_ng.h"
#include "core/components_ng/pattern/image/image_pattern.h"
#ifdef SECURITY_COMPONENT_ENABLE
#include "core/components_ng/pattern/security_component/security_component_handler.h"
#endif
#include "core/components_ng/pattern/security_component/security_component_pattern.h"
#include "core/components_ng/pattern/security_component/security_component_theme.h"
#include "core/components_ng/pattern/text/text_pattern.h"
@ -300,8 +303,12 @@ void SecurityComponentModelNG::SetBackgroundColor(const Color& value)
return;
}
bool res = false;
#ifdef SECURITY_COMPONENT_ENABLE
res = SecurityComponentHandler::IsSystemAppCalling();
#endif
Color resColor = value;
if (!IsInReleaseList(resColor.GetValue()) && !IsArkuiComponent() && IsBelowThreshold(value)) {
if (!res && !IsInReleaseList(resColor.GetValue()) && !IsArkuiComponent() && IsBelowThreshold(value)) {
resColor = value.ChangeAlpha(FULL_TRANSPARENCY_VALUE);
}
ACE_UPDATE_PAINT_PROPERTY(SecurityComponentPaintProperty, BackgroundColor, resColor);

View File

@ -101,6 +101,11 @@ public:
{
return true;
};
static bool IsSystemAppCalling()
{
return false;
};
};
} // namespace SecurityComponent
} // namespace Security