@Test public void test_calculate_max_distance_with_greater_right_value() { ContinuousWeightedSort continuousWeightedSort = new ContinuousWeightedSort(0, false, RadialSort.Position.TOP_LEFT, ContinuousWeightedSort.MEDIUM_WEIGHT, ContinuousWeightedSort.MEDIUM_WEIGHT); double max = 0; max = continuousWeightedSort.calculateMaxDistance(5, 6, max); Assert.assertEquals(6, max, 0); }
@VisibleForTesting double calculateMaxDistance(double leftHorizontalDistance, double rightHorizontalDistance, double maximum) { if (leftHorizontalDistance > rightHorizontalDistance && leftHorizontalDistance > maximum) { maximum = leftHorizontalDistance; } else if (rightHorizontalDistance > leftHorizontalDistance && rightHorizontalDistance > maximum) { maximum = rightHorizontalDistance; } return maximum; }
ContinuousWeightedSort extends ContinuousSort { @VisibleForTesting double calculateMaxDistance(double leftHorizontalDistance, double rightHorizontalDistance, double maximum) { if (leftHorizontalDistance > rightHorizontalDistance && leftHorizontalDistance > maximum) { maximum = leftHorizontalDistance; } else if (rightHorizontalDistance > leftHorizontalDistance && rightHorizontalDistance > maximum) { maximum = rightHorizontalDistance; } return maximum; } }
ContinuousWeightedSort extends ContinuousSort { @VisibleForTesting double calculateMaxDistance(double leftHorizontalDistance, double rightHorizontalDistance, double maximum) { if (leftHorizontalDistance > rightHorizontalDistance && leftHorizontalDistance > maximum) { maximum = leftHorizontalDistance; } else if (rightHorizontalDistance > leftHorizontalDistance && rightHorizontalDistance > maximum) { maximum = rightHorizontalDistance; } return maximum; } ContinuousWeightedSort(long interObjectDelay, boolean reversed, Position position,
                                  @FloatRange(from = 0.0) double horizontalWeight,
                                  @FloatRange(from = 0.0) double verticalWeight); }
ContinuousWeightedSort extends ContinuousSort { @VisibleForTesting double calculateMaxDistance(double leftHorizontalDistance, double rightHorizontalDistance, double maximum) { if (leftHorizontalDistance > rightHorizontalDistance && leftHorizontalDistance > maximum) { maximum = leftHorizontalDistance; } else if (rightHorizontalDistance > leftHorizontalDistance && rightHorizontalDistance > maximum) { maximum = rightHorizontalDistance; } return maximum; } ContinuousWeightedSort(long interObjectDelay, boolean reversed, Position position,
                                  @FloatRange(from = 0.0) double horizontalWeight,
                                  @FloatRange(from = 0.0) double verticalWeight); @Override List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children); @Override void sortChildren(ViewGroup parent, List<View> children); }
ContinuousWeightedSort extends ContinuousSort { @VisibleForTesting double calculateMaxDistance(double leftHorizontalDistance, double rightHorizontalDistance, double maximum) { if (leftHorizontalDistance > rightHorizontalDistance && leftHorizontalDistance > maximum) { maximum = leftHorizontalDistance; } else if (rightHorizontalDistance > leftHorizontalDistance && rightHorizontalDistance > maximum) { maximum = rightHorizontalDistance; } return maximum; } ContinuousWeightedSort(long interObjectDelay, boolean reversed, Position position,
                                  @FloatRange(from = 0.0) double horizontalWeight,
                                  @FloatRange(from = 0.0) double verticalWeight); @Override List<SpruceTimedView> getViewListWithTimeOffsets(ViewGroup parent, List<View> children); @Override void sortChildren(ViewGroup parent, List<View> children); static final double LIGHT_WEIGHT; static final double MEDIUM_WEIGHT; static final double HEAVY_WEIGHT; }