@Test public void test_get_distance_point_for_top_right() { corneredSort = new CorneredSort(0, false, CorneredSort.Corner.TOP_RIGHT); Mockito.when(mockParent.getWidth()).thenReturn(20); PointF resultPoint = corneredSort.getDistancePoint(mockParent, mockChildren); assertEquals(new PointF(20F, 0F), resultPoint); }
@Override public PointF getDistancePoint(ViewGroup parent, List<View> children) { PointF distancePoint; switch (corner) { case TOP_LEFT: distancePoint = new PointF(0, 0); break; case TOP_RIGHT: distancePoint = new PointF(parent.getWidth(), 0); break; case BOTTOM_LEFT: distancePoint = new PointF(0, parent.getHeight()); break; case BOTTOM_RIGHT: distancePoint = new PointF(parent.getWidth(), parent.getHeight()); break; default: throw new AssertionError("Must be a valid Corner argument type"); } return distancePoint; }
CorneredSort extends DistancedSort { @Override public PointF getDistancePoint(ViewGroup parent, List<View> children) { PointF distancePoint; switch (corner) { case TOP_LEFT: distancePoint = new PointF(0, 0); break; case TOP_RIGHT: distancePoint = new PointF(parent.getWidth(), 0); break; case BOTTOM_LEFT: distancePoint = new PointF(0, parent.getHeight()); break; case BOTTOM_RIGHT: distancePoint = new PointF(parent.getWidth(), parent.getHeight()); break; default: throw new AssertionError("Must be a valid Corner argument type"); } return distancePoint; } }
CorneredSort extends DistancedSort { @Override public PointF getDistancePoint(ViewGroup parent, List<View> children) { PointF distancePoint; switch (corner) { case TOP_LEFT: distancePoint = new PointF(0, 0); break; case TOP_RIGHT: distancePoint = new PointF(parent.getWidth(), 0); break; case BOTTOM_LEFT: distancePoint = new PointF(0, parent.getHeight()); break; case BOTTOM_RIGHT: distancePoint = new PointF(parent.getWidth(), parent.getHeight()); break; default: throw new AssertionError("Must be a valid Corner argument type"); } return distancePoint; } CorneredSort(long interObjectDelay, boolean reversed, Corner corner); }
CorneredSort extends DistancedSort { @Override public PointF getDistancePoint(ViewGroup parent, List<View> children) { PointF distancePoint; switch (corner) { case TOP_LEFT: distancePoint = new PointF(0, 0); break; case TOP_RIGHT: distancePoint = new PointF(parent.getWidth(), 0); break; case BOTTOM_LEFT: distancePoint = new PointF(0, parent.getHeight()); break; case BOTTOM_RIGHT: distancePoint = new PointF(parent.getWidth(), parent.getHeight()); break; default: throw new AssertionError("Must be a valid Corner argument type"); } return distancePoint; } CorneredSort(long interObjectDelay, boolean reversed, Corner corner); @Override List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children); @Override void sortChildren(ViewGroup parent, List<View> children); @Override PointF getDistancePoint(ViewGroup parent, List<View> children); }
CorneredSort extends DistancedSort { @Override public PointF getDistancePoint(ViewGroup parent, List<View> children) { PointF distancePoint; switch (corner) { case TOP_LEFT: distancePoint = new PointF(0, 0); break; case TOP_RIGHT: distancePoint = new PointF(parent.getWidth(), 0); break; case BOTTOM_LEFT: distancePoint = new PointF(0, parent.getHeight()); break; case BOTTOM_RIGHT: distancePoint = new PointF(parent.getWidth(), parent.getHeight()); break; default: throw new AssertionError("Must be a valid Corner argument type"); } return distancePoint; } CorneredSort(long interObjectDelay, boolean reversed, Corner corner); @Override List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children); @Override void sortChildren(ViewGroup parent, List<View> children); @Override PointF getDistancePoint(ViewGroup parent, List<View> children);  }