mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 01:03:08 +00:00
!44094 支持startAbility启动时定制启动页
Merge pull request !44094 from zzhcharmer/devUI
This commit is contained in:
commit
7e63c465c8
@ -17,8 +17,7 @@ import(
|
||||
if (is_ohos_standard_system) {
|
||||
config("window_scene_config") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
defines = []
|
||||
defines = [ "SUPPORT_GRAPHICS" ]
|
||||
cflags = []
|
||||
if (ace_engine_feature_asbng_path_enable) {
|
||||
defines += [ "ATOMIC_SERVICE_ATTRIBUTION_ENABLE" ]
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "core/components_ng/pattern/window_scene/scene/window_pattern.h"
|
||||
|
||||
#include "session_manager/include/scene_session_manager.h"
|
||||
#include "start_window_option.h"
|
||||
#include "ui/rs_surface_node.h"
|
||||
|
||||
#include "adapter/ohos/entrance/mmi_event_convertor.h"
|
||||
@ -375,6 +376,22 @@ void WindowPattern::CreateASStartingWindow()
|
||||
}
|
||||
#endif
|
||||
|
||||
void WindowPattern::UpdateStartingWindowProperty(const Rosen::SessionInfo& sessionInfo,
|
||||
Color &color, ImageSourceInfo &sourceInfo)
|
||||
{
|
||||
if (sessionInfo.startWindowOption == nullptr && !sessionInfo.startWindowOption->hasStartWindow) {
|
||||
return;
|
||||
}
|
||||
TAG_LOGI(AceLogTag::ACE_WINDOW_SCENE, "Get starting window info from session info");
|
||||
if (!sessionInfo.startWindowOption->startWindowBackgroundColor.empty()) {
|
||||
Color::ParseColorString(sessionInfo.startWindowOption->startWindowBackgroundColor, color);
|
||||
}
|
||||
if (sessionInfo.startWindowOption->startWindowIcon != nullptr) {
|
||||
auto pixelMap = PixelMap::CreatePixelMap(&(sessionInfo.startWindowOption->startWindowIcon));
|
||||
sourceInfo = ImageSourceInfo(pixelMap);
|
||||
}
|
||||
}
|
||||
|
||||
void WindowPattern::CreateStartingWindow()
|
||||
{
|
||||
const auto& sessionInfo = session_->GetSessionInfo();
|
||||
@ -400,6 +417,12 @@ void WindowPattern::CreateStartingWindow()
|
||||
startingWindow_->GetRenderContext()->UpdateBackgroundColor(Color(backgroundColor));
|
||||
imageLayoutProperty->UpdateImageSourceInfo(
|
||||
ImageSourceInfo(startupPagePath, sessionInfo.bundleName_, sessionInfo.moduleName_));
|
||||
auto sourceInfo = ImageSourceInfo(startupPagePath, sessionInfo.bundleName_, sessionInfo.moduleName_);
|
||||
auto color = Color(backgroundColor);
|
||||
UpdateStartingWindowProperty(sessionInfo, color, sourceInfo);
|
||||
|
||||
imageLayoutProperty->UpdateImageSourceInfo(sourceInfo);
|
||||
startingWindow_->GetRenderContext()->UpdateBackgroundColor(color);
|
||||
imageLayoutProperty->UpdateImageFit(ImageFit::NONE);
|
||||
startingWindow_->MarkModifyDone();
|
||||
}
|
||||
|
@ -106,6 +106,8 @@ private:
|
||||
void FilterInvalidPointerItem(const std::shared_ptr<MMI::PointerEvent>& pointerEvent);
|
||||
void UpdateSnapshotWindowProperty();
|
||||
bool IsSnapshotSizeChanged();
|
||||
void UpdateStartingWindowProperty(const Rosen::SessionInfo& sessionInfo,
|
||||
Color &color, ImageSourceInfo &sourceInfo);
|
||||
|
||||
std::shared_ptr<Rosen::ILifecycleListener> lifecycleListener_;
|
||||
RefPtr<TouchEventImpl> touchEvent_;
|
||||
|
Loading…
Reference in New Issue
Block a user