Index: ui/app_list/views/contents_animator.cc |
diff --git a/ui/app_list/views/contents_animator.cc b/ui/app_list/views/contents_animator.cc |
index e6519808bfe3c697114ad23f1d51dc4d8d5cadc4..a060e09379b33cbbac1b7fc6914822bf1479d1d8 100644 |
--- a/ui/app_list/views/contents_animator.cc |
+++ b/ui/app_list/views/contents_animator.cc |
@@ -37,8 +37,9 @@ ContentsAnimator::~ContentsAnimator() { |
} |
gfx::Rect ContentsAnimator::GetOnscreenPageBounds(int page_index) const { |
Matt Giuca
2015/02/09 03:51:14
I think it's better to simply move GetOnscreenPage
calamity
2015/02/09 05:25:14
SGTM. I'm going to move OffscreenBounds too.
|
- return contents_view_->GetPageIndexForState( |
- AppListModel::STATE_CUSTOM_LAUNCHER_PAGE) == page_index |
+ AppListModel::State state = contents_view_->GetStateForPageIndex(page_index); |
+ return (state == AppListModel::STATE_CUSTOM_LAUNCHER_PAGE || |
+ state == AppListModel::STATE_START) |
? contents_view_->GetContentsBounds() |
: contents_view_->GetDefaultContentsBounds(); |
} |
@@ -193,13 +194,14 @@ void StartToAppsAnimator::Update(double progress, |
int apps_page) { |
// TODO(mgiuca): This is just a clone of DefaultAnimator's animation. Write a |
// custom animation for the All Apps button on the Start page. |
- gfx::Rect on_screen(contents_view()->GetDefaultContentsBounds()); |
+ gfx::Rect from_page_onscreen(GetOnscreenPageBounds(start_page)); |
+ gfx::Rect to_page_onscreen(GetOnscreenPageBounds(apps_page)); |
gfx::Rect from_page_origin(GetOffscreenPageBounds(start_page)); |
gfx::Rect to_page_origin(GetOffscreenPageBounds(apps_page)); |
- gfx::Rect from_page_rect( |
- gfx::Tween::RectValueBetween(progress, on_screen, from_page_origin)); |
+ gfx::Rect from_page_rect(gfx::Tween::RectValueBetween( |
+ progress, from_page_onscreen, from_page_origin)); |
gfx::Rect to_page_rect( |
- gfx::Tween::RectValueBetween(progress, to_page_origin, on_screen)); |
+ gfx::Tween::RectValueBetween(progress, to_page_origin, to_page_onscreen)); |
contents_view()->GetPageView(start_page)->SetBoundsRect(from_page_rect); |
contents_view()->GetPageView(apps_page)->SetBoundsRect(to_page_rect); |