Home
last modified time | relevance | path

Searched refs:velocity (Results 1 – 25 of 25) sorted by relevance

/frameworks/base/core/java/android/widget/
DOverScroller.java657 static private float getDeceleration(int velocity) { in getDeceleration() argument
658 return velocity > 0 ? -GRAVITY : GRAVITY; in getDeceleration()
732 private void startSpringback(int start, int end, int velocity) { in startSpringback() argument
746 void fling(int start, int velocity, int min, int max, int over) { in fling() argument
749 mCurrVelocity = mVelocity = velocity; in fling()
755 startAfterEdge(start, min, max, velocity); in fling()
762 if (velocity != 0) { in fling()
763 mDuration = mSplineDuration = getSplineFlingDuration(velocity); in fling()
764 totalDistance = getSplineFlingDistance(velocity); in fling()
767 mSplineDistance = (int) (totalDistance * Math.signum(velocity)); in fling()
[all …]
DScroller.java456 float velocity = FloatMath.sqrt(velocityX * velocityX + velocityY * velocityY); in fling() local
458 mVelocity = velocity; in fling()
459 mDuration = getSplineFlingDuration(velocity); in fling()
464 float coeffX = velocity == 0 ? 1.0f : velocityX / velocity; in fling()
465 float coeffY = velocity == 0 ? 1.0f : velocityY / velocity; in fling()
467 double totalDistance = getSplineFlingDistance(velocity); in fling()
468 mDistance = (int) (totalDistance * Math.signum(velocity)); in fling()
486 private double getSplineDeceleration(float velocity) { in getSplineDeceleration() argument
487 return Math.log(INFLEXION * Math.abs(velocity) / (mFlingFriction * mPhysicalCoeff)); in getSplineDeceleration()
490 private int getSplineFlingDuration(float velocity) { in getSplineFlingDuration() argument
[all …]
DEdgeEffect.java284 public void onAbsorb(int velocity) { in onAbsorb() argument
286 velocity = Math.max(MIN_VELOCITY, Math.abs(velocity)); in onAbsorb()
289 mDuration = 0.1f + (velocity * 0.03f); in onAbsorb()
302 mEdgeAlphaFinish = Math.max(0, Math.min(velocity * VELOCITY_EDGE_FACTOR, 1)); in onAbsorb()
305 HELD_EDGE_SCALE_Y, Math.min(velocity * VELOCITY_EDGE_FACTOR, 1.f)); in onAbsorb()
311 mGlowScaleYFinish = Math.min(0.025f + (velocity * (velocity / 100) * 0.00015f), 1.75f); in onAbsorb()
314 mGlowAlphaStart, Math.min(velocity * VELOCITY_GLOW_FACTOR * .00001f, MAX_ALPHA)); in onAbsorb()
DSlidingDrawer.java440 float velocity = (float) Math.hypot(xVelocity, yVelocity); in onTouchEvent()
442 velocity = -velocity; in onTouchEvent()
448 if (Math.abs(velocity) < mMaximumTapVelocity) { in onTouchEvent()
465 performFling(vertical ? top : left, velocity, false); in onTouchEvent()
469 performFling(vertical ? top : left, velocity, false); in onTouchEvent()
472 performFling(vertical ? top : left, velocity, false); in onTouchEvent()
492 private void performFling(int position, float velocity, boolean always) {
494 mAnimatedVelocity = velocity;
497 if (always || (velocity > mMaximumMajorVelocity ||
499 velocity > -mMaximumMajorVelocity))) {
[all …]
DStackView.java1034 float getDurationForNeutralPosition(float velocity) {
1035 return getDuration(false, velocity);
1038 float getDurationForOffscreenPosition(float velocity) {
1039 return getDuration(true, velocity);
1042 private float getDuration(boolean invert, float velocity) {
1051 if (velocity == 0) {
1054 float duration = invert ? d / Math.abs(velocity) :
1055 (maxd - d) / Math.abs(velocity);
DAbsListView.java4175 int velocity = (int) scroller.getCurrVelocity();
4176 if (crossUp) velocity = -velocity;
4180 start(velocity);
/frameworks/support/v4/java/android/support/v4/widget/
DEdgeEffectCompat.java51 public boolean onAbsorb(Object edgeEffect, int velocity); in onAbsorb() argument
81 public boolean onAbsorb(Object edgeEffect, int velocity) { in onAbsorb() argument
115 public boolean onAbsorb(Object edgeEffect, int velocity) { in onAbsorb() argument
116 return EdgeEffectCompatIcs.onAbsorb(edgeEffect, velocity); in onAbsorb()
203 public boolean onAbsorb(int velocity) { in onAbsorb() argument
204 return IMPL.onAbsorb(mEdgeEffect, velocity); in onAbsorb()
DViewDragHelper.java617 private int computeAxisDuration(int delta, int velocity, int motionRange) { in computeAxisDuration() argument
629 velocity = Math.abs(velocity); in computeAxisDuration()
630 if (velocity > 0) { in computeAxisDuration()
631 duration = 4 * Math.round(1000 * Math.abs(distance / velocity)); in computeAxisDuration()
DSlidingPaneLayout.java993 boolean smoothSlideTo(float slideOffset, int velocity) { in smoothSlideTo() argument
/frameworks/base/packages/SystemUI/src/com/android/systemui/
DSwipeHelper.java272 public void dismissChild(final View view, float velocity) { in dismissChild() argument
277 if (velocity < 0 in dismissChild()
278 || (velocity == 0 && getTranslation(animView) < 0) in dismissChild()
280 || (velocity == 0 && getTranslation(animView) == 0 && mSwipeDirection == Y)) { in dismissChild()
286 if (velocity != 0) { in dismissChild()
289 .abs(velocity))); in dismissChild()
312 public void snapChild(final View view, float velocity) { in snapChild() argument
372 float velocity = getVelocity(mVelocityTracker); in onTouchEvent() local
378 boolean childSwipedFastEnough = (Math.abs(velocity) > escapeVelocity) && in onTouchEvent()
379 (Math.abs(velocity) > Math.abs(perpendicularVelocity)) && in onTouchEvent()
[all …]
/frameworks/base/docs/html/training/gestures/
Dmovement.jd17 <li><a href="#velocity">Track Velocity</a></li>
81 <li>The velocity of the pointer as it moves across the touch screen.</li>
87 <h2 id="velocity">Track Velocity</h2>
89 …that is simply based on the distance and/or direction the pointer traveled. But velocity often is a
91 whether the gesture occurred. To make velocity calculation easier, Android
96 android.view.VelocityTracker} helps you track the velocity of touch events. This
97 is useful for gestures in which velocity is part of the criteria for the
117 // Retrieve a new VelocityTracker object to watch the velocity of a motion.
121 // Reset the velocity tracker back to its initial state.
129 // When you want to determine the velocity, call
[all …]
Dviewgroup.jd182 These methods return the minimum and maximum velocity (respectively) to initiate a fling,
Dscroll.jd77 scrolling physics (friction, velocity, etc.). The scroller itself doesn't
/frameworks/base/core/jni/
Dandroid_view_VelocityTracker.cpp104 Velocity& velocity = mCalculatedVelocity[index]; in computeCurrentVelocity() local
105 velocity.vx = vx; in computeCurrentVelocity()
106 velocity.vy = vy; in computeCurrentVelocity()
118 const Velocity& velocity = mCalculatedVelocity[index]; in getVelocity() local
119 vx = velocity.vx; in getVelocity()
120 vy = velocity.vy; in getVelocity()
/frameworks/support/v4/ics/android/support/v4/widget/
DEdgeEffectCompatIcs.java56 public static boolean onAbsorb(Object edgeEffect, int velocity) { in onAbsorb() argument
57 ((EdgeEffect) edgeEffect).onAbsorb(velocity); in onAbsorb()
/frameworks/base/policy/src/com/android/internal/policy/impl/keyguard/
DSlidingChallengeLayout.java383 void animateChallengeTo(int y, int velocity) { in animateChallengeTo() argument
409 velocity = Math.abs(velocity); in animateChallengeTo()
410 if (velocity > 0) { in animateChallengeTo()
411 duration = 4 * Math.round(1000 * Math.abs(distance / velocity)); in animateChallengeTo()
1154 private void showChallenge(int velocity) {
1156 if (Math.abs(velocity) > mMinVelocity) {
1157 show = velocity < 0;
1161 showChallenge(show, velocity);
1164 private void showChallenge(boolean show, int velocity) {
1174 layoutBottom + mChallengeView.getHeight() - mChallengeBottomBound, velocity);
DPagedView.java1764 protected void snapToPageWithVelocity(int whichPage, int velocity) { in snapToPageWithVelocity() argument
1775 if (Math.abs(velocity) < mMinFlingVelocity) { in snapToPageWithVelocity()
1790 velocity = Math.abs(velocity); in snapToPageWithVelocity()
1791 velocity = Math.max(mMinSnapVelocity, velocity); in snapToPageWithVelocity()
1796 duration = 4 * Math.round(1000 * Math.abs(distance / velocity)); in snapToPageWithVelocity()
/frameworks/base/core/java/com/android/internal/widget/
DRotarySelector.java544 final int velocity = Math.max(mMinimumVelocity, rawVelocity); in onTouchEvent() local
547 Math.abs(velocity / mDimpleSpacing)); in onTouchEvent()
551 velocity); in onTouchEvent()
564 final int velocity = Math.min(-mMinimumVelocity, rawVelocity); in onTouchEvent() local
567 Math.abs(velocity / mDimpleSpacing)); in onTouchEvent()
571 velocity); in onTouchEvent()
/frameworks/ex/carousel/java/com/android/ex/carousel/
Dcarousel.rs236 static float velocity = 0.0f; // angular velocity in radians/s
673 float swayAngle = getSwayAngleForVelocity(velocity, enableSway);
1142 enableSelection = fabs(velocity) < selectionVelocity;
1143 velocity = 0.0f;
1198 velocity = computeAverageVelocityFromHistory();
1199 if (fabs(velocity) > stopVelocity) {
1251 velocity = computeAverageVelocityFromHistory();
1317 velocity = 0.0f;
1586 const float Ff = -frictionCoeff * velocity;
1602 const float momentum = mass * velocity + (Ff + Fr)*dt;
[all …]
/frameworks/support/v4/java/android/support/v4/view/
DViewPager.java512 void setCurrentItemInternal(int item, boolean smoothScroll, boolean always, int velocity) { in setCurrentItemInternal() argument
551 scrollToItem(item, smoothScroll, velocity, dispatchSelected); in setCurrentItemInternal()
555 private void scrollToItem(int item, boolean smoothScroll, int velocity, in scrollToItem() argument
565 smoothScrollTo(destX, 0, velocity); in scrollToItem()
787 void smoothScrollTo(int x, int y, int velocity) { in smoothScrollTo() argument
814 velocity = Math.abs(velocity); in smoothScrollTo()
815 if (velocity > 0) { in smoothScrollTo()
816 duration = 4 * Math.round(1000 * Math.abs(distance / velocity)); in smoothScrollTo()
2134 private int determineTargetPage(int currentPage, float pageOffset, int velocity, int deltaX) {
2136 if (Math.abs(deltaX) > mFlingDistance && Math.abs(velocity) > mMinimumVelocity) {
[all …]
/frameworks/base/docs/html/training/custom-views/
Dmaking-interactive.jd158 <p>To start a fling, call {@link android.widget.Scroller#fling fling()} with the starting velocity
160 maximum x and y values of the fling. For the velocity value, you can use the value computed for
171 <p class="note"><strong>Note:</strong> Although the velocity calculated by
175 velocity by a factor of
/frameworks/base/tests/TileBenchmark/src/com/test/tilebenchmark/
DProfileActivity.java245 mVelocitySpinner = (Spinner) findViewById(R.id.velocity); in onCreate()
/frameworks/ex/widget/java/com/android/ex/widget/
DStaggeredGridView.java365 final float velocity = VelocityTrackerCompat.getYVelocity(mVelocityTracker, in onTouchEvent() local
367 if (Math.abs(velocity) > mFlingVelocity) { // TODO in onTouchEvent()
369 mScroller.fling(0, 0, 0, (int) velocity, 0, 0, in onTouchEvent()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
DPhoneStatusBar.java2244 final int velocity = dir * width * 8; // 1000/8 = 125 ms duration
2249 mPile.dismissRowAnimated(_v, velocity);
/frameworks/base/core/java/android/webkit/
DWebViewClassic.java6834 float velocity = (float) Math.hypot(vx, vy);
6835 if (mLastVelocity > 0 && currentVelocity > 0 && velocity
6843 velocity = (float) Math.hypot(vx, vy);
6880 mLastVelocity = velocity;