Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +10 −2 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ public class PanelView extends FrameLayout { mVX = mVY = 0; MotionEventCopy last = null; int i = 0; int j = 0; float totalweight = 0f; float weight = 10f; for (final Iterator<MotionEventCopy> iter = mEventBuf.descendingIterator(); Loading @@ -121,6 +122,10 @@ public class PanelView extends FrameLayout { final MotionEventCopy event = iter.next(); if (last != null) { final float dt = (float) (event.t - last.t) / timebase; if (dt == 0) { last = event; continue; } final float dx = (event.x - last.x); final float dy = (event.y - last.y); if (FlingTracker.DEBUG) { Loading @@ -135,12 +140,15 @@ public class PanelView extends FrameLayout { mVY += weight * dy / dt; totalweight += weight; weight *= DECAY; j++; } last = event; i++; } if (j != 0) { mVX /= totalweight; mVY /= totalweight; } if (FlingTracker.DEBUG) { Slog.v("FlingTracker", "computed: vx=" + mVX + " vy=" + mVY); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +10 −2 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ public class PanelView extends FrameLayout { mVX = mVY = 0; MotionEventCopy last = null; int i = 0; int j = 0; float totalweight = 0f; float weight = 10f; for (final Iterator<MotionEventCopy> iter = mEventBuf.descendingIterator(); Loading @@ -121,6 +122,10 @@ public class PanelView extends FrameLayout { final MotionEventCopy event = iter.next(); if (last != null) { final float dt = (float) (event.t - last.t) / timebase; if (dt == 0) { last = event; continue; } final float dx = (event.x - last.x); final float dy = (event.y - last.y); if (FlingTracker.DEBUG) { Loading @@ -135,12 +140,15 @@ public class PanelView extends FrameLayout { mVY += weight * dy / dt; totalweight += weight; weight *= DECAY; j++; } last = event; i++; } if (j != 0) { mVX /= totalweight; mVY /= totalweight; } if (FlingTracker.DEBUG) { Slog.v("FlingTracker", "computed: vx=" + mVX + " vy=" + mVY); Loading