Loading packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +4 −2 Original line number Diff line number Diff line Loading @@ -116,8 +116,10 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { // bouncer. As that view's expansion shrinks, the bouncer appears. The bouncer // is fully hidden at full expansion (1) and fully visible when fully collapsed // (0). final float screenTravelPercentage = Math.abs((e1.getY() - e2.getY()) / mCentralSurfaces.getDisplayHeight()); final float dy = mBouncerInitiallyShowing ? e2.getY() - e1.getY() : e1.getY() - e2.getY(); final float screenTravelPercentage = Math.max(0, dy / mCentralSurfaces.getDisplayHeight()); setPanelExpansion(mBouncerInitiallyShowing ? screenTravelPercentage : 1 - screenTravelPercentage); return true; Loading packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -234,9 +234,9 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { final float distanceY = SCREEN_HEIGHT_PX * scrollAmount; final MotionEvent event1 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX, 0); final MotionEvent event2 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX - distanceY, 0); final MotionEvent event2 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX, 0); assertThat(gestureListenerCaptor.getValue().onScroll(event1, event2, 0, distanceY)) .isTrue(); Loading Loading
packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +4 −2 Original line number Diff line number Diff line Loading @@ -116,8 +116,10 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { // bouncer. As that view's expansion shrinks, the bouncer appears. The bouncer // is fully hidden at full expansion (1) and fully visible when fully collapsed // (0). final float screenTravelPercentage = Math.abs((e1.getY() - e2.getY()) / mCentralSurfaces.getDisplayHeight()); final float dy = mBouncerInitiallyShowing ? e2.getY() - e1.getY() : e1.getY() - e2.getY(); final float screenTravelPercentage = Math.max(0, dy / mCentralSurfaces.getDisplayHeight()); setPanelExpansion(mBouncerInitiallyShowing ? screenTravelPercentage : 1 - screenTravelPercentage); return true; Loading
packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -234,9 +234,9 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { final float distanceY = SCREEN_HEIGHT_PX * scrollAmount; final MotionEvent event1 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX, 0); final MotionEvent event2 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX - distanceY, 0); final MotionEvent event2 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX, 0); assertThat(gestureListenerCaptor.getValue().onScroll(event1, event2, 0, distanceY)) .isTrue(); Loading