Loading core/java/android/util/MathUtils.java +21 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,27 @@ public final class MathUtils { return start + (stop - start) * amount; } /** * Returns an interpolated angle in degrees between a set of start and end * angles. * <p> * Unlike {@link #lerp(float, float, float)}, the direction and distance of * travel is determined by the shortest angle between the start and end * angles. For example, if the starting angle is 0 and the ending angle is * 350, then the interpolated angle will be in the range [0,-10] rather * than [0,350]. * * @param start the starting angle in degrees * @param end the ending angle in degrees * @param amount the position between start and end in the range [0,1] * where 0 is the starting angle and 1 is the ending angle * @return the interpolated angle in degrees */ public static float lerpDeg(float start, float end, float amount) { final float minAngle = (((end - start) + 180) % 360) - 180; return minAngle * amount + start; } public static float norm(float start, float stop, float value) { return (value - start) / (stop - start); } Loading core/java/android/widget/RadialTimePickerView.java +190 −241 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/android/widget/TimePickerClockDelegate.java +2 −2 Original line number Diff line number Diff line Loading @@ -200,8 +200,8 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl a.recycle(); mRadialTimePickerView = (RadialTimePickerView) mainView.findViewById( R.id.radial_picker); mRadialTimePickerView = (RadialTimePickerView) mainView.findViewById(R.id.radial_picker); mRadialTimePickerView.applyAttributes(attrs, defStyleAttr, defStyleRes); setupListeners(); Loading Loading
core/java/android/util/MathUtils.java +21 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,27 @@ public final class MathUtils { return start + (stop - start) * amount; } /** * Returns an interpolated angle in degrees between a set of start and end * angles. * <p> * Unlike {@link #lerp(float, float, float)}, the direction and distance of * travel is determined by the shortest angle between the start and end * angles. For example, if the starting angle is 0 and the ending angle is * 350, then the interpolated angle will be in the range [0,-10] rather * than [0,350]. * * @param start the starting angle in degrees * @param end the ending angle in degrees * @param amount the position between start and end in the range [0,1] * where 0 is the starting angle and 1 is the ending angle * @return the interpolated angle in degrees */ public static float lerpDeg(float start, float end, float amount) { final float minAngle = (((end - start) + 180) % 360) - 180; return minAngle * amount + start; } public static float norm(float start, float stop, float value) { return (value - start) / (stop - start); } Loading
core/java/android/widget/RadialTimePickerView.java +190 −241 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/java/android/widget/TimePickerClockDelegate.java +2 −2 Original line number Diff line number Diff line Loading @@ -200,8 +200,8 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl a.recycle(); mRadialTimePickerView = (RadialTimePickerView) mainView.findViewById( R.id.radial_picker); mRadialTimePickerView = (RadialTimePickerView) mainView.findViewById(R.id.radial_picker); mRadialTimePickerView.applyAttributes(attrs, defStyleAttr, defStyleRes); setupListeners(); Loading