!1197 remoteAnimation退出动画前先截图

Merge pull request !1197 from chenhaiying/m2
This commit is contained in:
openharmony_ci
2022-07-16 06:06:23 +00:00
committed by Gitee
2 changed files with 10 additions and 5 deletions
+8
View File
@@ -143,6 +143,8 @@ WMError RemoteAnimation::NotifyAnimationTransition(sptr<WindowTransitionInfo> sr
auto srcTarget = CreateWindowAnimationTarget(srcInfo, srcNode);
// to avoid normal animation
srcNode->isPlayAnimationHide_ = true;
// update snapshot before animation
AAFwk::AbilityManagerClient::GetInstance()->UpdateMissionSnapShot(srcNode->abilityToken_);
windowRoot->RemoveWindowNode(srcNode->GetWindowId());
WLOGFI("RSWindowAnimation: app transition from id:%{public}u to id:%{public}u!",
srcNode->GetWindowId(), dstNode->GetWindowId());
@@ -178,6 +180,8 @@ WMError RemoteAnimation::NotifyAnimationMinimize(sptr<WindowTransitionInfo> srcI
}
WLOGFI("RSWindowAnimation: notify animation minimize Id:%{public}u!", srcNode->GetWindowId());
srcNode->isPlayAnimationHide_ = true;
// update snapshot before animation
AAFwk::AbilityManagerClient::GetInstance()->UpdateMissionSnapShot(srcNode->abilityToken_);
windowRoot->RemoveWindowNode(srcNode->GetWindowId());
wptr<WindowNode> weak = srcNode;
auto minimizeFunc = [weak]() {
@@ -209,6 +213,8 @@ WMError RemoteAnimation::NotifyAnimationClose(sptr<WindowTransitionInfo> srcInfo
}
WLOGFI("RSWindowAnimation: notify animation close id:%{public}u!", srcNode->GetWindowId());
srcNode->isPlayAnimationHide_ = true;
// update snapshot before animation
AAFwk::AbilityManagerClient::GetInstance()->UpdateMissionSnapShot(srcNode->abilityToken_);
windowRoot->RemoveWindowNode(srcNode->GetWindowId());
wptr<WindowNode> weak = srcNode;
auto closeFunc = [weak, event]() {
@@ -254,6 +260,8 @@ WMError RemoteAnimation::NotifyAnimationByHome(sptr<WindowRoot>& windowRoot)
continue;
}
srcNode->isPlayAnimationHide_ = true;
// update snapshot before animation
AAFwk::AbilityManagerClient::GetInstance()->UpdateMissionSnapShot(srcNode->abilityToken_);
windowRoot->RemoveWindowNode(srcNode->GetWindowId());
animationTargets.emplace_back(srcTarget);
}
+2 -5
View File
@@ -262,7 +262,7 @@ void WindowNodeContainer::RemoveWindowNodeFromWindowTree(sptr<WindowNode>& node)
void WindowNodeContainer::RemoveNodeFromRSTree(sptr<WindowNode>& node)
{
if (!node->isPlayAnimationHide_) {
if (!node->isPlayAnimationHide_) { // update rs tree after animation
bool isAnimationPlayed = false;
if (RemoteAnimation::CheckAnimationController() && WindowHelper::IsMainWindow(node->GetWindowType())) {
isAnimationPlayed = true;
@@ -270,7 +270,7 @@ void WindowNodeContainer::RemoveNodeFromRSTree(sptr<WindowNode>& node)
for (auto& displayId : node->GetShowingDisplays()) {
UpdateRSTree(node, displayId, false, isAnimationPlayed);
}
} else {
} else { // not update rs tree before animation
node->isPlayAnimationHide_ = false;
}
}
@@ -293,9 +293,6 @@ WMError WindowNodeContainer::RemoveWindowNode(sptr<WindowNode>& node)
// When RemoteAnimation exists, Remove node from RSTree after animation
RemoveNodeFromRSTree(node);
auto emptyVec = std::vector<DisplayId>();
node->showingDisplays_.swap(emptyVec);
displayGroupController_->UpdateDisplayGroupWindowTree();
layoutPolicy_->RemoveWindowNode(node);