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.animation.Animator; | 7 import android.animation.Animator; |
8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.res.Resources; | 10 import android.content.res.Resources; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 private float mMaxOverScrollSlide; | 181 private float mMaxOverScrollSlide; |
182 private final Interpolator mOverScrollAngleInterpolator = | 182 private final Interpolator mOverScrollAngleInterpolator = |
183 new AccelerateDecelerateInterpolator(); | 183 new AccelerateDecelerateInterpolator(); |
184 private final Interpolator mUnderScrollAngleInterpolator = | 184 private final Interpolator mUnderScrollAngleInterpolator = |
185 ChromeAnimation.getDecelerateInterpolator(); | 185 ChromeAnimation.getDecelerateInterpolator(); |
186 private final Interpolator mOverscrollSlideInterpolator = | 186 private final Interpolator mOverscrollSlideInterpolator = |
187 new AccelerateDecelerateInterpolator(); | 187 new AccelerateDecelerateInterpolator(); |
188 | 188 |
189 // Drag Lock | 189 // Drag Lock |
190 private DragLock mDragLock = DragLock.NONE; | 190 private DragLock mDragLock = DragLock.NONE; |
191 private long mLastScrollUpdate = 0; | 191 private long mLastScrollUpdate; |
192 private float mMinScrollMotion = 0; | 192 private float mMinScrollMotion; |
193 | 193 |
194 // Scrolling Variables | 194 // Scrolling Variables |
195 private float mScrollTarget = 0; | 195 private float mScrollTarget; |
196 private float mScrollOffset = 0; | 196 private float mScrollOffset; |
197 private float mScrollOffsetForDyingTabs = 0; | 197 private float mScrollOffsetForDyingTabs; |
198 private float mCurrentScrollDirection = 0.0f; | 198 private float mCurrentScrollDirection; |
199 private StackTab mScrollingTab = null; | 199 private StackTab mScrollingTab; |
200 | 200 |
201 // Swipe Variables | 201 // Swipe Variables |
202 private float mSwipeUnboundScrollOffset; | 202 private float mSwipeUnboundScrollOffset; |
203 private float mSwipeBoundedScrollOffset; | 203 private float mSwipeBoundedScrollOffset; |
204 private boolean mSwipeIsCancelable; | 204 private boolean mSwipeIsCancelable; |
205 private boolean mSwipeCanScroll; | 205 private boolean mSwipeCanScroll; |
206 private boolean mInSwipe; | 206 private boolean mInSwipe; |
207 | 207 |
208 // Discard | 208 // Discard |
209 private StackTab mDiscardingTab; | 209 private StackTab mDiscardingTab; |
(...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 public void swipeFlingOccurred( | 2543 public void swipeFlingOccurred( |
2544 long time, float x, float y, float tx, float ty, float vx, float vy)
{ | 2544 long time, float x, float y, float tx, float ty, float vx, float vy)
{ |
2545 if (!mInSwipe) return; | 2545 if (!mInSwipe) return; |
2546 | 2546 |
2547 // Propagate the fling data. | 2547 // Propagate the fling data. |
2548 fling(time, x, y, vx, vy); | 2548 fling(time, x, y, vx, vy); |
2549 | 2549 |
2550 onUpOrCancel(time); | 2550 onUpOrCancel(time); |
2551 } | 2551 } |
2552 } | 2552 } |
OLD | NEW |