Commit 352a82ac authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Reset transforms on app list content views when the drag starts

Updates UpdateYPositionAndOpacity::UpdateYPositionAndOpacity to reset
transforms for views whose transform might have been changed in
ContentsView::AnimateToViewState(). This will ensure that the views are
positioned appropriatelly, and prevent them from animating as app list
view drag starts.

BUG=1042740

Change-Id: I1227a8ae52098d28331075ff1c681a6d16276137
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2005377
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732563}
parent 1a7be35f
......@@ -260,6 +260,14 @@ void AppsContainerView::UpdateYPositionAndOpacity(float progress,
chip_grid_y_distance_);
page_switcher_->SetY(suggestion_chip_container_view_->y() +
chip_grid_y_distance_);
// If app list is in drag, reset transforms that might started animating in
// AnimateYPosition().
if (app_list_view->is_in_drag()) {
suggestion_chip_container_view_->layer()->SetTransform(gfx::Transform());
apps_grid_view_->layer()->SetTransform(gfx::Transform());
page_switcher_->layer()->SetTransform(gfx::Transform());
}
}
void AppsContainerView::OnTabletModeChanged(bool started) {
......
......@@ -794,6 +794,15 @@ void ContentsView::UpdateYPositionAndOpacity() {
search_box_bounds);
}
// If in drag, reset the transforms that might have been set in
// AnimateToViewState().
if (app_list_view_->is_in_drag()) {
search_box->layer()->SetTransform(gfx::Transform());
expand_arrow_view_->layer()->SetTransform(gfx::Transform());
for (AppListPage* page : app_list_pages_)
page->layer()->SetTransform(gfx::Transform());
}
if (app_list_features::IsScalableAppListEnabled() ||
current_state == AppListState::kStateApps) {
// Layout the apps container at the position where it would be with apps
......
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