@Test public void test_inter_object_delay_of_zero() { List<SpruceTimedView> resultViews = new CorneredSort(0, false, CorneredSort.Corner.TOP_LEFT) .getViewListWithTimeOffsets(mockParent, mockChildren); assertEquals(0, resultViews.get(0).getTimeOffset()); assertEquals(0, resultViews.get(1).getTimeOffset()); assertEquals(0, resultViews.get(2).getTimeOffset()); }
@Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { final PointF comparisonPoint = getDistancePoint(parent, children); List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; double lastDistance = 0; for (View view : children) { double viewDistance = getDistanceBetweenPoints(Utils.viewToPoint(view), comparisonPoint); if (Math.floor(lastDistance) != Math.floor(viewDistance)) { lastDistance = viewDistance; currentTimeOffset += interObjectDelay; } timedViews.add(new SpruceTimedView(view, currentTimeOffset)); } return timedViews; }
CorneredSort extends DistancedSort { @Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { final PointF comparisonPoint = getDistancePoint(parent, children); List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; double lastDistance = 0; for (View view : children) { double viewDistance = getDistanceBetweenPoints(Utils.viewToPoint(view), comparisonPoint); if (Math.floor(lastDistance) != Math.floor(viewDistance)) { lastDistance = viewDistance; currentTimeOffset += interObjectDelay; } timedViews.add(new SpruceTimedView(view, currentTimeOffset)); } return timedViews; } }
CorneredSort extends DistancedSort { @Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { final PointF comparisonPoint = getDistancePoint(parent, children); List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; double lastDistance = 0; for (View view : children) { double viewDistance = getDistanceBetweenPoints(Utils.viewToPoint(view), comparisonPoint); if (Math.floor(lastDistance) != Math.floor(viewDistance)) { lastDistance = viewDistance; currentTimeOffset += interObjectDelay; } timedViews.add(new SpruceTimedView(view, currentTimeOffset)); } return timedViews; } CorneredSort(long interObjectDelay, boolean reversed, Corner corner); }
CorneredSort extends DistancedSort { @Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { final PointF comparisonPoint = getDistancePoint(parent, children); List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; double lastDistance = 0; for (View view : children) { double viewDistance = getDistanceBetweenPoints(Utils.viewToPoint(view), comparisonPoint); if (Math.floor(lastDistance) != Math.floor(viewDistance)) { lastDistance = viewDistance; currentTimeOffset += interObjectDelay; } timedViews.add(new SpruceTimedView(view, currentTimeOffset)); } return timedViews; } 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 List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { final PointF comparisonPoint = getDistancePoint(parent, children); List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; double lastDistance = 0; for (View view : children) { double viewDistance = getDistanceBetweenPoints(Utils.viewToPoint(view), comparisonPoint); if (Math.floor(lastDistance) != Math.floor(viewDistance)) { lastDistance = viewDistance; currentTimeOffset += interObjectDelay; } timedViews.add(new SpruceTimedView(view, currentTimeOffset)); } return timedViews; } 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);  }