Commit 8363b891 authored by Jazz Xu's avatar Jazz Xu Committed by Commit Bot

[Lockscreen Media Controls] Media controls layout modification.

Update lock screen media controls layout and icons.

Bug: 1015133
Change-Id: I288f4826e490c18d40217ddbfd4305b25fd8c514
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865717Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Commit-Queue: Jazz Xu <jazzhsu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707402}
parent 84ab4dfd
......@@ -36,7 +36,7 @@ using media_session::test::TestMediaController;
namespace {
const int kAppIconSize = 20;
constexpr int kArtworkViewHeight = 80;
constexpr int kArtworkViewHeight = 48;
constexpr int kArtworkCornerRadius = 4;
const base::string16 kTestAppName = base::ASCIIToUTF16("Test app");
......@@ -746,7 +746,7 @@ TEST_F(LockScreenMediaControlsViewTest, UpdateArtwork) {
{
// Verify that the provided artwork is correctly scaled down.
gfx::Rect expected_artwork_bounds(0, 20, 80, 40);
gfx::Rect expected_artwork_bounds(0, 12, 48, 24);
gfx::Rect artwork_bounds = artwork_view()->GetImageBounds();
EXPECT_EQ(expected_artwork_bounds, artwork_bounds);
......@@ -758,14 +758,14 @@ TEST_F(LockScreenMediaControlsViewTest, UpdateArtwork) {
}
// Create artwork that must be scaled up to fit the view.
artwork.allocN32Pixels(40, 70);
artwork.allocN32Pixels(20, 40);
media_controls_view_->MediaControllerImageChanged(
media_session::mojom::MediaSessionImageType::kArtwork, artwork);
{
// Verify that the provided artwork is correctly scaled up.
gfx::Rect expected_artwork_bounds(17, 0, 45, 80);
gfx::Rect expected_artwork_bounds(12, 0, 24, 48);
gfx::Rect artwork_bounds = artwork_view()->GetImageBounds();
EXPECT_EQ(expected_artwork_bounds, artwork_bounds);
......@@ -777,14 +777,14 @@ TEST_F(LockScreenMediaControlsViewTest, UpdateArtwork) {
}
// Create artwork that already fits the view size.
artwork.allocN32Pixels(70, kArtworkViewHeight);
artwork.allocN32Pixels(30, kArtworkViewHeight);
media_controls_view_->MediaControllerImageChanged(
media_session::mojom::MediaSessionImageType::kArtwork, artwork);
{
// Verify that the provided artwork size doesn't change.
gfx::Rect expected_artwork_bounds(5, 0, 70, 80);
gfx::Rect expected_artwork_bounds(9, 0, 30, 48);
gfx::Rect artwork_bounds = artwork_view()->GetImageBounds();
EXPECT_EQ(expected_artwork_bounds, artwork_bounds);
......
......@@ -6,6 +6,7 @@
#include "ash/login/ui/non_accessible_view.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
......@@ -26,12 +27,10 @@ namespace ash {
namespace {
constexpr gfx::Insets kHeaderViewInsets = gfx::Insets(0, 0, 15, 0);
constexpr int kIconViewSize = 18;
constexpr int kIconSize = 12;
constexpr int kIconViewSize = 20;
constexpr int kIconSize = 14;
constexpr int kHeaderTextFontSize = 12;
constexpr gfx::Insets kIconPadding = gfx::Insets(1, 1, 1, 1);
constexpr gfx::Insets kAppNamePadding = gfx::Insets(0, 10, 0, 0);
constexpr gfx::Insets kAppNamePadding = gfx::Insets(0, 8, 0, 0);
constexpr gfx::Size kAppNamePreferredSize = gfx::Size(200, 10);
constexpr gfx::Size kCloseButtonSize = gfx::Size(20, 20);
constexpr int kCloseButtonIconSize = 18;
......@@ -54,13 +53,11 @@ MediaControlsHeaderView::MediaControlsHeaderView(
views::MaximumFlexSizeRule::kUnbounded)
.WithOrder(2);
auto* layout = SetLayoutManager(std::make_unique<views::FlexLayout>());
layout->SetInteriorMargin(kHeaderViewInsets);
SetLayoutManager(std::make_unique<views::FlexLayout>());
auto app_icon_view = std::make_unique<views::ImageView>();
app_icon_view->SetPreferredSize(gfx::Size(kIconViewSize, kIconViewSize));
app_icon_view->SetImageSize(gfx::Size(kIconSize, kIconSize));
app_icon_view->SetBorder(views::CreateEmptyBorder(kIconPadding));
app_icon_view->SetBackground(
views::CreateRoundedRectBackground(SK_ColorWHITE, kIconViewSize / 2));
......@@ -76,7 +73,9 @@ MediaControlsHeaderView::MediaControlsHeaderView(
auto app_name_view = std::make_unique<views::Label>();
app_name_view->SetFontList(font_list);
app_name_view->SetHorizontalAlignment(gfx::ALIGN_LEFT);
app_name_view->SetEnabledColor(SK_ColorWHITE);
app_name_view->SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextSecondary,
AshColorProvider::AshColorMode::kDark));
app_name_view->SetAutoColorReadabilityEnabled(false);
app_name_view->SetBorder(views::CreateEmptyBorder(kAppNamePadding));
app_name_view->SetPreferredSize(kAppNamePreferredSize);
......
......@@ -120,12 +120,6 @@ aggregate_vector_icons("ash_vector_icons") {
"palette_tray_icon_magnify.icon",
"palette_tray_icon_metalayer.icon",
"parent_access_lock.icon",
"lock_screen_pause.icon",
"lock_screen_play.icon",
"lock_screen_previous_track.icon",
"lock_screen_next_track.icon",
"lock_screen_seek_forward.icon",
"lock_screen_seek_backward.icon",
"send.icon",
"settings.icon",
"shelf_add_person_button.icon",
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 24,
MOVE_TO, 2, 25,
R_ARC_TO, 1.53f, 1.53f, 0, 0, 1, -0.69f, -0.17f,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 0.5f, 23.54f,
V_LINE_TO, 2,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 2.86f, 0.77f,
LINE_TO, 18.25f, 11.54f,
R_ARC_TO, 1.52f, 1.52f, 0, 0, 1, 0, 2.46f,
LINE_TO, 2.86f, 24.77f,
ARC_TO, 1.51f, 1.51f, 0, 0, 1, 2, 25,
CLOSE,
MOVE_TO, 3.5f, 4.88f,
V_LINE_TO, 20.66f,
R_LINE_TO, 11.27f, -7.89f,
CLOSE,
MOVE_TO, 23.23f, 25,
R_ARC_TO, 1.5f, 1.5f, 0, 0, 1, -1.5f, -1.5f,
V_LINE_TO, 2,
R_ARC_TO, 1.5f, 1.5f, 0, 0, 1, 3, 0,
V_LINE_TO, 23.54f,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 23.23f, 25,
CLOSE
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 40,
MOVE_TO, 7.5f, 39.5f,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 6, 38,
V_LINE_TO, 2,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 9, 2,
V_LINE_TO, 38,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 7.5f, 39.5f,
CLOSE,
MOVE_TO, 32.5f, 39.5f,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 31, 38,
V_LINE_TO, 2,
R_ARC_TO, 1.5f, 1.5f, 0, 0, 1, 3, 0,
V_LINE_TO, 38,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 32.5f, 39.5f,
CLOSE
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 40,
MOVE_TO, 7, 39.5f,
R_ARC_TO, 1.57f, 1.57f, 0, 0, 1, -0.7f, -0.17f,
ARC_TO, 1.51f, 1.51f, 0, 0, 1, 5.5f, 38,
V_LINE_TO, 2,
ARC_TO, 1.49f, 1.49f, 0, 0, 1, 7.85f, 0.77f,
R_LINE_TO, 26, 18,
R_ARC_TO, 1.49f, 1.49f, 0, 0, 1, 0, 2.46f,
R_LINE_TO, -26, 18,
ARC_TO, 1.46f, 1.46f, 0, 0, 1, 7, 39.5f,
CLOSE,
MOVE_TO, 8.5f, 4.86f,
V_LINE_TO, 35.14f,
LINE_TO, 30.37f, 20,
CLOSE
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 24,
MOVE_TO, 22.73f, 24.54f,
R_ARC_TO, 1.51f, 1.51f, 0, 0, 1, -0.86f, -0.27f,
LINE_TO, 6.49f, 13.5f,
R_ARC_TO, 1.5f, 1.5f, 0, 0, 1, 0, -2.46f,
LINE_TO, 21.87f, 0.27f,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 24.23f, 1.5f,
V_LINE_TO, 23,
R_ARC_TO, 1.5f, 1.5f, 0, 0, 1, -1.5f, 1.5f,
CLOSE,
MOVE_TO, 10, 12.27f,
R_LINE_TO, 11.26f, 7.89f,
V_LINE_TO, 4.38f,
CLOSE,
MOVE_TO, 1.5f, 24.54f,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 0, 23,
V_LINE_TO, 1.5f,
R_ARC_TO, 1.5f, 1.5f, 0, 0, 1, 3, 0,
V_LINE_TO, 23,
ARC_TO, 1.5f, 1.5f, 0, 0, 1, 1.5f, 24.54f,
CLOSE
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 24,
MOVE_TO, 9.44f, 18.88f,
ARC_TO, 0.89f, 0.89f, 0, 0, 1, 9, 18.72f,
R_LINE_TO, -8.58f, -6,
R_ARC_TO, 0.87f, 0.87f, 0, 0, 1, -0.22f, -1.2f,
R_ARC_TO, 0.88f, 0.88f, 0, 0, 1, 0.22f, -0.21f,
LINE_TO, 9, 5.3f,
R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, 0.86f, -0.06f,
R_ARC_TO, 0.84f, 0.84f, 0, 0, 1, 0.45f, 0.76f,
V_LINE_TO, 18,
R_ARC_TO, 0.84f, 0.84f, 0, 0, 1, -0.45f, 0.76f,
ARC_TO, 1, 1, 0, 0, 1, 9.44f, 18.88f,
CLOSE,
MOVE_TO, 2.36f, 12,
R_LINE_TO, 6.22f, 4.36f,
V_LINE_TO, 7.65f,
CLOSE,
MOVE_TO, 23.18f, 18.88f,
R_ARC_TO, 0.84f, 0.84f, 0, 0, 1, -0.49f, -0.16f,
R_LINE_TO, -8.59f, -6,
R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, -0.21f, -1.2f,
R_ARC_TO, 1, 1, 0, 0, 1, 0.21f, -0.21f,
R_LINE_TO, 8.59f, -6,
ARC_TO, 0.83f, 0.83f, 0, 0, 1, 24, 6,
V_LINE_TO, 18,
R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, -0.45f, 0.76f,
ARC_TO, 1, 1, 0, 0, 1, 23.18f, 18.88f,
CLOSE,
MOVE_TO, 16.09f, 12,
R_LINE_TO, 6.23f, 4.36f,
V_LINE_TO, 7.65f,
CLOSE
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 24,
MOVE_TO, 0.86f, 18.87f,
R_ARC_TO, 0.93f, 0.93f, 0, 0, 1, -0.4f, -0.09f,
ARC_TO, 0.86f, 0.86f, 0, 0, 1, 0, 18,
V_LINE_TO, 6,
R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, 0.46f, -0.76f,
R_ARC_TO, 0.85f, 0.85f, 0, 0, 1, 0.93f, 0.06f,
R_LINE_TO, 8.58f, 6,
R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, 0.21f, 1.2f,
R_ARC_TO, 0.84f, 0.84f, 0, 0, 1, -0.21f, 0.21f,
R_LINE_TO, -8.58f, 6,
ARC_TO, 0.84f, 0.84f, 0, 0, 1, 0.86f, 18.87f,
CLOSE,
MOVE_TO, 1.72f, 7.65f,
R_V_LINE_TO, 8.72f,
LINE_TO, 8, 12,
CLOSE,
MOVE_TO, 14.59f, 18.87f,
R_ARC_TO, 0.93f, 0.93f, 0, 0, 1, -0.4f, -0.09f,
R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, -0.46f, -0.76f,
V_LINE_TO, 6,
R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, 0.46f, -0.76f,
R_ARC_TO, 0.85f, 0.85f, 0, 0, 1, 0.86f, 0.06f,
R_LINE_TO, 8.58f, 6,
R_ARC_TO, 0.87f, 0.87f, 0, 0, 1, 0.22f, 1.2f,
R_ARC_TO, 0.88f, 0.88f, 0, 0, 1, -0.22f, 0.21f,
R_LINE_TO, -8.58f, 6,
ARC_TO, 0.84f, 0.84f, 0, 0, 1, 14.59f, 18.87f,
CLOSE,
R_MOVE_TO, 0.86f, -11.22f,
R_V_LINE_TO, 8.72f,
LINE_TO, 21.68f, 12,
CLOSE
......@@ -6,6 +6,7 @@
#include "base/i18n/time_formatting.h"
#include "services/media_session/public/mojom/media_session.mojom.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/font_list.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
......@@ -19,7 +20,8 @@ namespace media_message_center {
namespace {
constexpr int kProgressBarAndTimeSpacing = 3;
constexpr SkColor kTimeColor = gfx::kGoogleGrey200;
constexpr int kProgressBarAndTimeSpacing = 8;
constexpr int kProgressTimeFontSize = 11;
constexpr int kProgressBarHeight = 4;
constexpr int kMinClickHeight = 14;
......@@ -56,7 +58,7 @@ MediaControlsProgressView::MediaControlsProgressView(
auto progress_time = std::make_unique<views::Label>();
progress_time->SetFontList(font_list);
progress_time->SetEnabledColor(SK_ColorWHITE);
progress_time->SetEnabledColor(kTimeColor);
progress_time->SetAutoColorReadabilityEnabled(false);
progress_time_ = time_view->AddChildView(std::move(progress_time));
......
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