Commit 01d00996 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix folder flash issue

Bug: 872804
Change-Id: I2cac9c78c0d7c1fdde72741509f275b7273b7b12
Reviewed-on: https://chromium-review.googlesource.com/1169778
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582267}
parent 8780d73e
...@@ -116,10 +116,6 @@ class BackgroundAnimation : public gfx::SlideAnimation, ...@@ -116,10 +116,6 @@ class BackgroundAnimation : public gfx::SlideAnimation,
} }
void AnimationEnded(const gfx::Animation* animation) override { void AnimationEnded(const gfx::Animation* animation) override {
if (!show_) {
folder_view_->background_view()->SetBackground(nullptr);
folder_view_->background_view()->SchedulePaint();
}
folder_view_->RecordAnimationSmoothness(); folder_view_->RecordAnimationSmoothness();
} }
...@@ -206,12 +202,8 @@ class FolderItemTitleAnimation : public gfx::SlideAnimation, ...@@ -206,12 +202,8 @@ class FolderItemTitleAnimation : public gfx::SlideAnimation,
class TopIconAnimation : public AppListFolderView::Animation, class TopIconAnimation : public AppListFolderView::Animation,
public TopIconAnimationObserver { public TopIconAnimationObserver {
public: public:
TopIconAnimation(bool show, TopIconAnimation(bool show, AppListFolderView* folder_view)
bool hide_for_reparent, : show_(show), folder_view_(folder_view) {}
AppListFolderView* folder_view)
: show_(show),
hide_for_reparent_(hide_for_reparent),
folder_view_(folder_view) {}
~TopIconAnimation() override { ~TopIconAnimation() override {
for (auto* view : top_icon_views_) for (auto* view : top_icon_views_)
...@@ -287,10 +279,8 @@ class TopIconAnimation : public AppListFolderView::Animation, ...@@ -287,10 +279,8 @@ class TopIconAnimation : public AppListFolderView::Animation,
SetFirstPageItemViewsVisible(true); SetFirstPageItemViewsVisible(true);
// Show the folder icon when closing the folder. // Show the folder icon when closing the folder.
if ((!show_ || hide_for_reparent_) && if (!show_ && folder_view_->GetActivatedFolderItemView())
folder_view_->GetActivatedFolderItemView()) {
folder_view_->GetActivatedFolderItemView()->SetIconVisible(true); folder_view_->GetActivatedFolderItemView()->SetIconVisible(true);
}
} }
private: private:
...@@ -345,9 +335,6 @@ class TopIconAnimation : public AppListFolderView::Animation, ...@@ -345,9 +335,6 @@ class TopIconAnimation : public AppListFolderView::Animation,
// True if opening the folder. // True if opening the folder.
const bool show_; const bool show_;
// True if an item in the folder is being reparented to root grid view.
const bool hide_for_reparent_;
AppListFolderView* const folder_view_; // Not owned. AppListFolderView* const folder_view_; // Not owned.
std::vector<TopIconAnimationView*> top_icon_views_; std::vector<TopIconAnimationView*> top_icon_views_;
...@@ -527,8 +514,7 @@ void AppListFolderView::ScheduleShowHideAnimation(bool show, ...@@ -527,8 +514,7 @@ void AppListFolderView::ScheduleShowHideAnimation(bool show,
// Animate the bounds and opacity of items in the first page of the opened // Animate the bounds and opacity of items in the first page of the opened
// folder. // folder.
top_icon_animation_ = top_icon_animation_ = std::make_unique<TopIconAnimation>(show, this);
std::make_unique<TopIconAnimation>(show, hide_for_reparent, this);
top_icon_animation_->ScheduleAnimation(); top_icon_animation_->ScheduleAnimation();
// Animate the bounds and opacity of the contents container. // Animate the bounds and opacity of the contents container.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment