OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.compositor.bottombar; | 5 package org.chromium.chrome.browser.compositor.bottombar; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Color; | 8 import android.graphics.Color; |
9 import android.view.ViewGroup; | 9 import android.view.ViewGroup; |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 /** The height of the Bar when the Panel is maximized, in dps. */ | 102 /** The height of the Bar when the Panel is maximized, in dps. */ |
103 private final float mBarHeightMaximized; | 103 private final float mBarHeightMaximized; |
104 | 104 |
105 /** Ratio of dps per pixel. */ | 105 /** Ratio of dps per pixel. */ |
106 protected final float mPxToDp; | 106 protected final float mPxToDp; |
107 | 107 |
108 /** | 108 /** |
109 * The Y coordinate to apply to the Base Page in order to keep the selection | 109 * The Y coordinate to apply to the Base Page in order to keep the selection |
110 * in view when the Overlay Panel is in its EXPANDED state. | 110 * in view when the Overlay Panel is in its EXPANDED state. |
111 */ | 111 */ |
112 private float mBasePageTargetY = 0.f; | 112 private float mBasePageTargetY; |
113 | 113 |
114 /** The current context. */ | 114 /** The current context. */ |
115 protected final Context mContext; | 115 protected final Context mContext; |
116 | 116 |
117 /** The current state of the Overlay Panel. */ | 117 /** The current state of the Overlay Panel. */ |
118 private PanelState mPanelState = PanelState.UNDEFINED; | 118 private PanelState mPanelState = PanelState.UNDEFINED; |
119 | 119 |
120 /** | 120 /** |
121 * Valid previous states for the Panel. | 121 * Valid previous states for the Panel. |
122 */ | 122 */ |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 381 } |
382 | 382 |
383 // -------------------------------------------------------------------------
------------------- | 383 // -------------------------------------------------------------------------
------------------- |
384 // Panel Bar states | 384 // Panel Bar states |
385 // -------------------------------------------------------------------------
------------------- | 385 // -------------------------------------------------------------------------
------------------- |
386 private float mBarMarginSide; | 386 private float mBarMarginSide; |
387 private float mBarHeight; | 387 private float mBarHeight; |
388 private boolean mIsBarBorderVisible; | 388 private boolean mIsBarBorderVisible; |
389 private float mBarBorderHeight; | 389 private float mBarBorderHeight; |
390 | 390 |
391 private boolean mBarShadowVisible = false; | 391 private boolean mBarShadowVisible; |
392 private float mBarShadowOpacity = 0.f; | 392 private float mBarShadowOpacity; |
393 | 393 |
394 private float mArrowIconOpacity; | 394 private float mArrowIconOpacity; |
395 | 395 |
396 private float mCloseIconOpacity; | 396 private float mCloseIconOpacity; |
397 private float mCloseIconWidth; | 397 private float mCloseIconWidth; |
398 | 398 |
399 /** | 399 /** |
400 * @return The side margin of the Bar. | 400 * @return The side margin of the Bar. |
401 */ | 401 */ |
402 public float getBarMarginSide() { | 402 public float getBarMarginSide() { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return getOffsetX() + getBarMarginSide(); | 478 return getOffsetX() + getBarMarginSide(); |
479 } else { | 479 } else { |
480 return getOffsetX() + getWidth() - getBarMarginSide() - getCloseIcon
Dimension(); | 480 return getOffsetX() + getWidth() - getBarMarginSide() - getCloseIcon
Dimension(); |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
484 // -------------------------------------------------------------------------
------------------- | 484 // -------------------------------------------------------------------------
------------------- |
485 // Base Page states | 485 // Base Page states |
486 // -------------------------------------------------------------------------
------------------- | 486 // -------------------------------------------------------------------------
------------------- |
487 | 487 |
488 private float mBasePageY = 0.0f; | 488 private float mBasePageY; |
489 private float mBasePageBrightness = 1.0f; | 489 private float mBasePageBrightness = 1.0f; |
490 | 490 |
491 /** | 491 /** |
492 * @return The vertical offset of the base page. | 492 * @return The vertical offset of the base page. |
493 */ | 493 */ |
494 public float getBasePageY() { | 494 public float getBasePageY() { |
495 return mBasePageY; | 495 return mBasePageY; |
496 } | 496 } |
497 | 497 |
498 /** | 498 /** |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 * Overrides the FullWidthSizePanel state for testing. | 1181 * Overrides the FullWidthSizePanel state for testing. |
1182 * | 1182 * |
1183 * @param isFullWidthSizePanel Whether the Panel has a full width size. | 1183 * @param isFullWidthSizePanel Whether the Panel has a full width size. |
1184 */ | 1184 */ |
1185 @VisibleForTesting | 1185 @VisibleForTesting |
1186 public void setIsFullWidthSizePanelForTesting(boolean isFullWidthSizePanel)
{ | 1186 public void setIsFullWidthSizePanelForTesting(boolean isFullWidthSizePanel)
{ |
1187 mOverrideIsFullWidthSizePanelForTesting = true; | 1187 mOverrideIsFullWidthSizePanelForTesting = true; |
1188 mIsFullWidthSizePanelForTesting = isFullWidthSizePanel; | 1188 mIsFullWidthSizePanelForTesting = isFullWidthSizePanel; |
1189 } | 1189 } |
1190 } | 1190 } |
OLD | NEW |