| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.layouts.phone.stack; | 5 package org.chromium.chrome.browser.compositor.layouts.phone.stack; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.res.Resources; | 8 import android.content.res.Resources; |
| 9 | 9 |
| 10 import org.chromium.base.annotations.SuppressFBWarnings; | 10 import org.chromium.base.annotations.SuppressFBWarnings; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // Cached values from values/dimens.xml | 40 // Cached values from values/dimens.xml |
| 41 public static float sStackedTabVisibleSize; // stacked_tab_visible_size | 41 public static float sStackedTabVisibleSize; // stacked_tab_visible_size |
| 42 public static float sStackBufferWidth; // stack_buffer_width | 42 public static float sStackBufferWidth; // stack_buffer_width |
| 43 public static float sStackBufferHeight; // stack_buffer_height | 43 public static float sStackBufferHeight; // stack_buffer_height |
| 44 | 44 |
| 45 // Positioner selector | 45 // Positioner selector |
| 46 private float mXInStackInfluence = 1.0f; | 46 private float mXInStackInfluence = 1.0f; |
| 47 private float mYInStackInfluence = 1.0f; | 47 private float mYInStackInfluence = 1.0f; |
| 48 | 48 |
| 49 // In stack positioner | 49 // In stack positioner |
| 50 private float mScrollOffset = 0.0f; | 50 private float mScrollOffset; |
| 51 private float mXInStackOffset = 0.0f; | 51 private float mXInStackOffset; |
| 52 private float mYInStackOffset = 0.0f; | 52 private float mYInStackOffset; |
| 53 | 53 |
| 54 // Out of stack positioner | 54 // Out of stack positioner |
| 55 private float mXOutOfStack = 0.0f; | 55 private float mXOutOfStack; |
| 56 private float mYOutOfStack = 0.0f; | 56 private float mYOutOfStack; |
| 57 | 57 |
| 58 // Values that get animated | 58 // Values that get animated |
| 59 private float mAlpha = 1.0f; | 59 private float mAlpha = 1.0f; |
| 60 private float mScale = 1.0f; | 60 private float mScale = 1.0f; |
| 61 private float mDiscardAmount = 0.0f; // This might alter position, rotation
and alpha | 61 private float mDiscardAmount; // This might alter position, rotation and alp
ha |
| 62 | 62 |
| 63 // Discard states | 63 // Discard states |
| 64 private float mDiscardOriginX; | 64 private float mDiscardOriginX; |
| 65 private float mDiscardOriginY; | 65 private float mDiscardOriginY; |
| 66 private boolean mDiscardFromClick; | 66 private boolean mDiscardFromClick; |
| 67 | 67 |
| 68 // The index of the tab in the stack | 68 // The index of the tab in the stack |
| 69 private int mIndex; | 69 private int mIndex; |
| 70 | 70 |
| 71 // True if the tab is currently being removed (while animating). | 71 // True if the tab is currently being removed (while animating). |
| 72 protected boolean mDying = false; | 72 protected boolean mDying; |
| 73 | 73 |
| 74 // The visibility sorting value is used to determine the importance of the t
ab for | 74 // The visibility sorting value is used to determine the importance of the t
ab for |
| 75 // texture allocation. It is computed from the area and its position in the
stack. | 75 // texture allocation. It is computed from the area and its position in the
stack. |
| 76 // Larger values will have more priority for acquiring texture. Negative val
ues "often" | 76 // Larger values will have more priority for acquiring texture. Negative val
ues "often" |
| 77 // means that the tab is not visible at all (but there are no guaranty and i
t's fine). | 77 // means that the tab is not visible at all (but there are no guaranty and i
t's fine). |
| 78 private float mCachedVisibleArea = 0; // Intermediate value | 78 private float mCachedVisibleArea; // Intermediate value |
| 79 private float mCachedIndexDistance = 0; // Intermediate value | 79 private float mCachedIndexDistance; // Intermediate value |
| 80 private float mCacheStackVisibility = 1.0f; // Intermediate value | 80 private float mCacheStackVisibility = 1.0f; // Intermediate value |
| 81 private long mVisiblitySortingValue = 0; // Sorting value based on visible a
rea. | 81 private long mVisiblitySortingValue; // Sorting value based on visible area. |
| 82 private int mOrderSortingValue = 0; // Sorting value based on distance to se
lection. | 82 private int mOrderSortingValue; // Sorting value based on distance to select
ion. |
| 83 | 83 |
| 84 private LayoutTab mLayoutTab; | 84 private LayoutTab mLayoutTab; |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * @param tab The tab this instance is supposed to draw. | 87 * @param tab The tab this instance is supposed to draw. |
| 88 */ | 88 */ |
| 89 public StackTab(LayoutTab tab) { | 89 public StackTab(LayoutTab tab) { |
| 90 mLayoutTab = tab; | 90 mLayoutTab = tab; |
| 91 } | 91 } |
| 92 | 92 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 break; | 515 break; |
| 516 case DISCARD_AMOUNT: | 516 case DISCARD_AMOUNT: |
| 517 setDiscardAmount(val); | 517 setDiscardAmount(val); |
| 518 break; | 518 break; |
| 519 } | 519 } |
| 520 } | 520 } |
| 521 | 521 |
| 522 @Override | 522 @Override |
| 523 public void onPropertyAnimationFinished(Property prop) {} | 523 public void onPropertyAnimationFinished(Property prop) {} |
| 524 } | 524 } |
| OLD | NEW |