Commit 31982ac5 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix search box's overlap with suggestion chip

Changes:
Update the y positions of child views to target state upon animation
start to avoid stale positions.

Bug: 901168
Change-Id: I605d20302a7512b82ffe5cf445e7166f64da3280
Reviewed-on: https://chromium-review.googlesource.com/c/1315810
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605053}
parent 3f852913
......@@ -243,6 +243,9 @@ void AppListPresenterImpl::UpdateYPositionAndOpacityForHomeLauncher(
}
layer->SetOpacity(opacity);
layer->SetTransform(translation);
// Update child views' y positions to target state to avoid stale positions.
view_->app_list_main_view()->contents_view()->UpdateYPositionAndOpacity();
}
void AppListPresenterImpl::ScheduleOverviewModeAnimation(bool start,
......
......@@ -1260,9 +1260,9 @@ void AppListView::StartAnimationForState(AppListViewState target_state) {
layer->SetTransform(gfx::Transform());
// In transition animation, layout is only performed after it is complete,
// which makes the child views jump. So layout in advance here to avoid that.
GetAppsContainerView()->InvalidateLayout();
Layout();
// which makes the child views jump. So update y positions in advance here to
// avoid that.
app_list_main_view_->contents_view()->UpdateYPositionAndOpacity();
}
void AppListView::StartCloseAnimation(base::TimeDelta animation_duration) {
......
......@@ -1945,9 +1945,11 @@ void AppsGridView::UpdateOpacity() {
// changes from 0.f to 1.0f.
const float peeking_to_fullscreen_height =
app_list_view->GetFullscreenStateHeight() - peeking_height;
DCHECK_GT(peeking_to_fullscreen_height, 0);
const float drag_amount = current_height - peeking_height;
fraction = std::max(drag_amount / peeking_to_fullscreen_height, 0.f);
fraction = std::max(peeking_to_fullscreen_height > 0
? drag_amount / peeking_to_fullscreen_height
: 1.0f,
0.f);
opacity = std::min(std::max((fraction + kAllAppsIndicatorOpacityEndFraction -
kAllAppsIndicatorOpacityStartFraction - 1.0f) /
(kAllAppsIndicatorOpacityEndFraction -
......
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