Commit 43c432ee authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

app list: Start translating background shiled up at kHalf height

During app list drag, the app list background shield is gradually
translated up so it ends up with rounded corners above the display in
the full screen state. The translation is currently applied during drag
between peeking and fullscreen state. Given that kHalf state
(i.e. extended peeking state for search results UI) is above peeking
state, starting drag from kHalf state would immediately apply
non-identity transform on the background shield, causing the app list
view to jump up.
This CL changes the starting height at which the background shield
starts getting translated up at the larger, kHalf height, thus avoiding
the background shield jump when drag starts.

BUG=None

Change-Id: I47ea834f87cfd2836058a91954a7aad5bda36a8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824077
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699646}
parent 6d1bc83e
......@@ -2233,8 +2233,13 @@ void AppListView::UpdateAppListBackgroundYPosition(
// Update the y position of the background shield.
gfx::Transform transform;
if (is_in_drag_) {
// For the purpose of determining background shield offset, use progress
// with kHalf baseline so the background shield does not start translating
// up before it reaches kHalf height (which is larger than kPeeking height).
// If the shield transform started at kPeeking height, the app list view
// background would jump up when starting drag from the kHalf state.
float app_list_transition_progress =
GetAppListTransitionProgress(kProgressFlagNone);
GetAppListTransitionProgress(kProgressFlagSearchResults);
if (app_list_transition_progress < 1 && !shelf_has_rounded_corners()) {
const float shelf_height =
GetScreenBottom() - GetDisplayNearestView().work_area().bottom();
......
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