Features
Improved Sliders
Animations
AbstractSliderBehavior and AbstractRangeSliderBehavior now support handle movement animations through new animateHandleMove parameters. The provided animation controls the way handles travel to their new value. These animations do not affect the underlying value of the slider though; it is set instantly still.
These base classes also provide new APIs to indicate when the pointer has pressed or released in a way that causes the handles to adjust.
New marks system
Sliders can now have an arbitrary set of marks that denote specific values. This is an expansion of the previous ticks property, which only supported a uniformly spaced set of values. Marks are added to a Slider (or other variants) using a Marker. Markers define the set of marks and determine which mark is closest to a given value. These APIs are used to provide a set of mark values and in handling snapping behavior.
Snapping has been overhauled as well to make it more flexible. Sliders now take a SnappingPolicy that controls when to snap to the closest mark. This provides a lot of control over snap sensitivity or even selectiveness about which marks can snap.
There are also methods for specifying marks and snapping behavior using a list of values.
New handle bounding-box APIs
Slider and RangeSlider now expose the bounds of their handles. This is useful when trying to place popups to show the current value. These popups are even easier to do now b/c PopupManager's show method now lets you provide a Rectangle relative to the View you are anchoring to--instead of assuming it should be that View's bounds.
Animations using cubic-beziers
Animation easings are simply functions that map a "time" value in the range [0,1] to an output in the same range. This means you could already create any arbitrary easing and even use cubic-beziers to do this. But the latter is non-trivial, so there is now a built-in way to directly use cubic-beziers.
The new cubicBezier function returns an EasingFunction, so it works with all the existing animation APIs. The following lets you play with various curves to see how the affect the animation.
New Accordion control
The Accordion lets you show content in a set of sections that can each be collapsed or expanded individually. Each section rendered using an ItemVisualizer that generates the header View and a separate visualizer that renders the content for the section.
This control is strongly typed, which means it can hold a uniformed type of data. This data can be provided during construction of the accordion, but it is also dynamic and changeable afterward.
This control is intended to be very flexible like TabbedPanel, so it provides a less restrictive API and delegates a lot of decision-making to AccordionBehavior. The basicAccordionBehavior provides a simple implementation with some customization to get started.
Squircles and smooth corners
New smooth and squircle for creating smoothed corners on Rectangles that make it easy to achieve the "squircle" shape.
More flexible popup placement
- New API in
PopupManagerthat allows positioning a popup relative to aRectanglewithin the coordinates of aView
APIs
ValueSlidernow uses a newMarkerAPI to define where marks (previously ticks) are placed on it.ValueSlidernow uses a newSnappingPolicyAPI to define how it snaps to marks.ValueSlidernow hasmarkerChangedandsnappingPolicyChangedevents for subclasses to notify of these changes.- New utilities for creating various
MarkerandSnappingPolicyvalues. - New extension to mark a
ValueSliderusing anIterable. - New
BasicAccordionBehavior - New
AnimatableTreeRowIconto expand capability for basic tree and accordion behaviors - New
ItemVisualizer<String, C>.invokemethod to visualize a value as a String. - New
Color.grayScaleextension property to replaceColor.grayScale()extension method. - New
ColorPaint.invertedproperty to create a new paint based on the inverted color. - New
ColorPaint.grayScaleextension property to replaceColorPaint.grayScale()extension method. - New
Photo.aspectRatioproperty - New
Renderer.horizontalLineandRenderer.verticalLinemethods. - New extensions to create a
Strokefrom aColorandPaint. BasicSwitchBehaviornow takes a lambda that allows control of transition animation.BasicSelectBoxBehaviorandBasicMutableSelectBoxBehaviornow has color mappers for list and button hovers- Object versions of several
ItemVisualizers to make them easier to use. The constructor forms of some are now deprecated. - New
Rectangle.smoothextension that creates a superellipse path from a rectangle. - New
Slider.handleRectangleproperty that gives the current bounds of the handle/knob. BasicCircularSliderBehaviornewshowTicksandstartAngleconstructor paramsBasicCircularRangeSliderBehaviornewshowTicksandstartAngleconstructor paramsnativeSliderBehavior(Web) now supports ticks, enabled viashowTicksparameter- New APIs in
AbstractSliderBehaviorandAbstractRangeSliderBehaviorto indicate when a slider's handles are "pressed" and "released". - New
RangeSlider.handleRectangleproperty that gives the current bounds of the handle/knob. SliderBehaviornow hashandleBoundsmethodRangeSliderBehaviornow hasstartHandleBoundsandendHandleBoundsmethodsAbstractSliderBehaviornow supports animation of value changes throughanimateHandleMoveconstructor parameterAbstractRangeSliderBehaviornow supports animation of value changes throughanimateHandleMoveconstructor parameterAbstractCircularSliderBehavior.startAnglefor subclassesAbstractCircularRangeSliderBehavior.startAnglefor subclassesPhotonow allows aradiusto be specified to round its corners.LabelBehaviornow has ameasureTextmethod that takes an assumed width that should be used instead of the label's current width- New native behaviors for
Labelthat use the system default font Color.darker,Color.lighter,HslColor.darkerandHslColor.lighterare nowinfix.- New
HslColor.opacityextension to get a new color with the specified opacity - New
HsvColor.lightnessextension
Fixes | Improvements
-
General
- Issue where
BasicSliderBehaviorstill showing ticks whenshowTicks == null SliderandRangeSlidernow delegate calls tocontainsto theirbehaviorinstead of checkingsuperfirst.- Issue where
Labeldid not return an updated preferredSize withwrapsWordsenabled - Updated
SliderTeststo validate newmarkerfunctionality - New
RangeSliderTeststo validate newmarkerfunctionality
- Issue where
-
Docs
- Added basic docs for
GenericTextEditOperation - Fixed docs for
KeyValueTable
- Added basic docs for
Versions
- Measured -> 0.4.2