1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef ASH_WM_SPLITVIEW_SPLIT_VIEW_CONSTANTS_H_
6 #define ASH_WM_SPLITVIEW_SPLIT_VIEW_CONSTANTS_H_
7 
8 #include "ash/ash_export.h"
9 #include "third_party/skia/include/core/SkColor.h"
10 
11 namespace ash {
12 
13 // The ratio between a highlight view's primary axis, and the screens
14 // primary axis.
15 ASH_EXPORT constexpr float kHighlightScreenPrimaryAxisRatio = 0.10;
16 
17 // The padding between a highlight view and the edge of the screen.
18 ASH_EXPORT constexpr float kHighlightScreenEdgePaddingDp = 8;
19 
20 // The amount of inset to be applied on a split view label. Here horizontal and
21 // vertical apply to the orientation before rotation (if there is rotation).
22 constexpr int kSplitviewLabelHorizontalInsetDp = 12;
23 constexpr int kSplitviewLabelVerticalInsetDp = 4;
24 
25 // The preferred height of a split view label.
26 constexpr int kSplitviewLabelPreferredHeightDp = 24;
27 
28 // The amount of round applied to the corners of a split view label.
29 constexpr int kSplitviewLabelRoundRectRadiusDp = 12;
30 
31 // The thickness of the divider when it is not being dragged.
32 constexpr int kSplitviewDividerShortSideLength = 8;
33 
34 // The thickness of the divider during dragging.
35 constexpr int kSplitviewDividerEnlargedShortSideLength = 16;
36 
37 // The time duration for the window transformation animations.
38 constexpr auto kSplitviewWindowTransformDuration =
39     base::TimeDelta::FromMilliseconds(250);
40 
41 // The time duration for the divider animations when dragging starts and ends.
42 constexpr auto kSplitviewDividerSelectionStatusChangeDuration =
43     base::TimeDelta::FromMilliseconds(250);
44 
45 // The time duration for the divider spawning animation.
46 constexpr auto kSplitviewDividerSpawnDuration =
47     base::TimeDelta::FromMilliseconds(100);
48 
49 // The delay before the divider spawning animation.
50 constexpr auto kSplitviewDividerSpawnDelay =
51     base::TimeDelta::FromMilliseconds(183);
52 
53 // The thickness of the divider's handler.
54 constexpr int kSplitviewWhiteBarShortSideLength = 2;
55 
56 // The length of the divider's handler.
57 constexpr int kSplitviewWhiteBarLongSideLength = 16;
58 
59 // The corner radius of the divider's handler.
60 constexpr int kSplitviewWhiteBarCornerRadius = 1;
61 
62 // The radius of the circular handler when the divider is being dragged.
63 constexpr int kSplitviewWhiteBarRadius = 4;
64 
65 // The length of the divider's handler when it spawns.
66 constexpr int kSplitviewWhiteBarSpawnLongSideLength = 2;
67 
68 // The distance from the divider to where its handler spawns.
69 constexpr int kSplitviewWhiteBarSpawnUnsignedOffset = 2;
70 
71 // The opacity of the drag-to-snap or cannot-snap drag indicator.
72 constexpr float kHighlightOpacity = 0.3f;
73 constexpr float kDarkLightHighlightOpacity = 0.4f;
74 constexpr float kDarkLightHighlightCannotSnapOpacity = 0.2f;
75 
76 // The opacity of the split view snap preview area.
77 constexpr float kPreviewAreaHighlightOpacity = 0.18f;
78 constexpr float kDarkLightPreviewAreaHighlightOpacity = 0.2f;
79 
80 }  // namespace ash
81 
82 #endif  // ASH_WM_SPLITVIEW_SPLIT_VIEW_CONSTANTS_H_
83