Commit fee0985c authored by Ana Salazar's avatar Ana Salazar Committed by Commit Bot

Cros: Use transforms for animations in cardified state

When entering or exiting cardfified state, we now use transforms for app
icons so that animations run smoothier and in a more controlled way.

Bug: 1108643
Change-Id: Ib3d0728e62bc360b98c04910ea9793eb39dc1b40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335556
Commit-Queue: Ana Salazar <anasalazar@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795771}
parent 99d2ea06
This diff is collapsed.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <tuple> #include <tuple>
#include <vector>
#include "ash/app_list/app_list_export.h" #include "ash/app_list/app_list_export.h"
#include "ash/app_list/model/app_list_model.h" #include "ash/app_list/model/app_list_model.h"
...@@ -47,7 +48,7 @@ namespace ash { ...@@ -47,7 +48,7 @@ namespace ash {
namespace test { namespace test {
class AppsGridViewTest; class AppsGridViewTest;
class AppsGridViewTestApi; class AppsGridViewTestApi;
} } // namespace test
class ApplicationDragAndDropHost; class ApplicationDragAndDropHost;
class AppListConfig; class AppListConfig;
...@@ -317,6 +318,8 @@ class APP_LIST_EXPORT AppsGridView : public views::View, ...@@ -317,6 +318,8 @@ class APP_LIST_EXPORT AppsGridView : public views::View,
void RemoveBackgroundCard(); void RemoveBackgroundCard();
// Masks the apps grid container to background cards bounds. // Masks the apps grid container to background cards bounds.
void MaskContainerToBackgroundBounds(); void MaskContainerToBackgroundBounds();
// Removes all background cards from |background_cards_|.
void RemoveAllBackgroundCards();
// Return the view model. // Return the view model.
views::ViewModelT<AppListItemView>* view_model() { return &view_model_; } views::ViewModelT<AppListItemView>* view_model() { return &view_model_; }
...@@ -539,6 +542,9 @@ class APP_LIST_EXPORT AppsGridView : public views::View, ...@@ -539,6 +542,9 @@ class APP_LIST_EXPORT AppsGridView : public views::View,
void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override; void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override;
void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override; void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override;
// Call OnBoundsAnimatorDone when all layer animations finish.
void MaybeCallOnBoundsAnimatorDone();
// Hide a given view temporarily without losing (mouse) events and / or // Hide a given view temporarily without losing (mouse) events and / or
// changing the size of it. If |immediate| is set the change will be // changing the size of it. If |immediate| is set the change will be
// immediately applied - otherwise it will change gradually. // immediately applied - otherwise it will change gradually.
...@@ -918,6 +924,10 @@ class APP_LIST_EXPORT AppsGridView : public views::View, ...@@ -918,6 +924,10 @@ class APP_LIST_EXPORT AppsGridView : public views::View,
// card during cardified state. // card during cardified state.
std::vector<std::unique_ptr<ui::Layer>> background_cards_; std::vector<std::unique_ptr<ui::Layer>> background_cards_;
int bounds_animation_for_cardified_state_in_progress_ = 0;
base::WeakPtrFactory<AppsGridView> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(AppsGridView); DISALLOW_COPY_AND_ASSIGN(AppsGridView);
}; };
......
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