Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Eche] Add new views for recent apps loading state
This CL introduces new views for the recent apps view to represent a loading state. A follow-up CL will include the logic for displaying the loading view, error view, and transition to the normal recent apps buttons view. Screen capture showing the animation: https://drive.google.com/file/d/1uEOnaXQUT7SY2aug-e663vu-yUeqPgsR/view?usp=sharing&resourcekey=0-bxDJXQsjU0IS7W3B61cqbg Test: Manually verified that when setting loading_view_ to visible it will show. Verified that the non-loading view and buttons still work as intended. Bug: b/271478560 Change-Id: Ifb1d1cb8830dadbd5164a774a9eaa116cb024754 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4307837 Reviewed-by: Jon Mann <jonmann@chromium.org> Commit-Queue: Curt Clemens <cclem@google.com> Reviewed-by: Pu Shi <pushi@google.com> Cr-Commit-Position: refs/heads/main@{#1118447}
- Loading branch information
Curt Clemens
authored and
Chromium LUCI CQ
committed
Mar 17, 2023
1 parent
7116a8e
commit 971477f
Showing
13 changed files
with
280 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_SYSTEM_PHONEHUB_PHONE_HUB_APP_ICON_H_ | ||
#define ASH_SYSTEM_PHONEHUB_PHONE_HUB_APP_ICON_H_ | ||
#include "ash/ash_export.h" | ||
#include "ui/views/controls/image_view.h" | ||
|
||
namespace ash { | ||
|
||
class ASH_EXPORT AppIcon : public views::ImageView { | ||
public: | ||
// Measured in DIPs. | ||
static constexpr int kSizeSmall = 20; | ||
static constexpr int kSizeNormal = 32; | ||
|
||
static constexpr gfx::Size GetRecommendedImageSize(int icon_size) { | ||
// Leave 1 DP of space around the image to avoid the appearance of clipping. | ||
constexpr int kRecommendedImageInset = 1; | ||
|
||
int length_minus_insets = icon_size - 2 * kRecommendedImageInset; | ||
return gfx::Size(length_minus_insets, length_minus_insets); | ||
} | ||
|
||
AppIcon(const gfx::Image& icon, int size); | ||
AppIcon(const AppIcon&) = delete; | ||
AppIcon& operator=(const AppIcon&) = delete; | ||
|
||
~AppIcon() override = default; | ||
|
||
// views::View: | ||
const char* GetClassName() const override; | ||
}; | ||
} // namespace ash | ||
|
||
#endif // ASH_SYSTEM_PHONEHUB_PHONE_HUB_APP_ICON_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_SYSTEM_PHONEHUB_PHONE_HUB_APP_LOADING_ICON_H_ | ||
#define ASH_SYSTEM_PHONEHUB_PHONE_HUB_APP_LOADING_ICON_H_ | ||
|
||
#include "ash/ash_export.h" | ||
#include "ash/system/phonehub/phone_hub_app_icon.h" | ||
|
||
namespace ash { | ||
|
||
class ASH_EXPORT AppLoadingIcon : public AppIcon { | ||
public: | ||
explicit AppLoadingIcon(int size); | ||
}; | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_SYSTEM_PHONEHUB_PHONE_HUB_APP_LOADING_ICON_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.