@Test public void test_inter_object_delay_of_zero() { List<SpruceTimedView> resultViews = new RandomSort(0) .getViewListWithTimeOffsets(mockParent, mockChildren); Assert.assertEquals(0, resultViews.get(0).getTimeOffset()); Assert.assertEquals(0, resultViews.get(1).getTimeOffset()); Assert.assertEquals(0, resultViews.get(2).getTimeOffset()); }
@Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; for (View view : children) { timedViews.add(new SpruceTimedView(view, currentTimeOffset)); currentTimeOffset += interObjectDelay; } return timedViews; }
RandomSort extends SortFunction { @Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; for (View view : children) { timedViews.add(new SpruceTimedView(view, currentTimeOffset)); currentTimeOffset += interObjectDelay; } return timedViews; } }
RandomSort extends SortFunction { @Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; for (View view : children) { timedViews.add(new SpruceTimedView(view, currentTimeOffset)); currentTimeOffset += interObjectDelay; } return timedViews; } RandomSort(long interObjectDelay); }
RandomSort extends SortFunction { @Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; for (View view : children) { timedViews.add(new SpruceTimedView(view, currentTimeOffset)); currentTimeOffset += interObjectDelay; } return timedViews; } RandomSort(long interObjectDelay); @Override List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children); @Override void sortChildren(ViewGroup parent, List<View> children); }
RandomSort extends SortFunction { @Override public List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children) { List<SpruceTimedView> timedViews = new ArrayList<>(); long currentTimeOffset = 0; for (View view : children) { timedViews.add(new SpruceTimedView(view, currentTimeOffset)); currentTimeOffset += interObjectDelay; } return timedViews; } RandomSort(long interObjectDelay); @Override List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children); @Override void sortChildren(ViewGroup parent, List<View> children);  }