Features
New Carousel Control
The new Carousel control is a View that contains a lazy list of items generated from a ListModel. It delegates all decisions about what items to show to a Presenter obtained from its CarouselBehavior. The Carousel only displays items the Presenter requests as it moves through frames. This means it can scale to very large datasets as long as the Presenter only shows items that are visible.
Carousels can have a very wide range of layouts and behaviors. This flexibility is achieved by giving Presenters full control over which items (including supplemental ones not based on the data model) are shown at any point, how opaque they are, their positioning, size, transform, clipping, etc.. With this, you can create almost any kind of carousel experience you'd like.
Carousel transitioning is a key part of their behavior. The control is therefore fully dynamic and interactive. You can move between frames in two ways. Either by skipping ahead or backward or by manually moving the Carousel to an x/y offset and then letting it transition to the best frame when manual movement is complete. Carousels rely on a Transitioner to manage the way they animate for all these movements. This allows a great deal of flexibility and customization.
Presenters are responsible for updating frame state whenever the Carousel adjusts anything. This allows for holistic animations. There are several built-in Presenters that show how to create various effects as well.
val carousel = Carousel(
SimpleListModel(listOf(image1, image2, image3)),
itemVisualizer { item, previous, _ ->
when (previous) {
is DynamicImage -> previous.also { it.update(item) }
else -> DynamicImage(item)
}
}
).apply {
wrapAtEnds = true
acceptsThemes = false
behavior = object: CarouselBehavior<Image> {
override val presenter = LinearPresenter<Image>(spacing = 10.0) {
val aspectRatio = it.width.readOnly / it.height.readOnly
it.width eq parent.width
it.center eq parent.center
it.height eq it.width / aspectRatio
}
override val transitioner = dampedTransitioner<Image>(timer, animationScheduler) { _,_,_, update ->
animate(0f to 1f, using = tweenFloat(easeInOutCubic, duration = 1 * seconds)) {
update(it)
}
}
}
}Animations Can Now Be Paused/Resumed
The Animations implement the new Pausable interface, which allows them to be paused and resumed at any time.
val animation = animate.invoke(0f to 1f, using = tweenFloat(easeInOutCubic, duration = 1 * seconds)) {
// ...
}
animation.pause()
// ..
animation.resume()view | container Improvements
These DSLs now expose more of the protected properties of View and Container respectively.
view {
+ view {} // adds a child to the View
chidren += view {} // children now accessible
layout = simpleLayout {} // access layout
addedToDisplay = { } // called when view added to display
removedFromDisplay = { } // called when view removed from display
contains = { _ -> false } // called to decide if a point within the view
// ..
}APIs
-
General
Vector3Dnow exposes itsmagnitudebasicMenuBehaviormodule function now exposes various configuration input parameters to customize the result.TreeItemRolenow has aselectedproperty- New lerp function for
RectangleandSize - New
Rectangleconstructor that takes aSize BasicDropdownBehaviornow takes Accessibility label for its buttonBasicMutableDropdownBehaviornow takes Accessibility label for its buttonBasicSpinnerBehaviornow takes Accessibility labels for its buttonsBasicMutableSpinnerBehaviornow takes Accessibility labels for its buttonsbasicDropdownBehavior(),basicMutableDropdownBehavior(),basicSpinnerBehavior()andbasicMutableSpinnerBehavior()now support accessibility labelsBasicDropdownBehaviorandBasicMutableDropdownBehaviornow allowinsetto be specifiedbasicDropdownBehavior()andbasicMutableDropdownBehavior()now take an optionalinsetMonthPanelclass is now open- New
FieldState.ifInvalidutility function
-
Browser
- Auto-complete can now be disabled for
nativeTextFieldBehavior
- Auto-complete can now be disabled for
Fixes | Improvements
-
General
- Bug where
MonthPanelcould NPE if selection queried while nothing selected - Bug in
TextMetricssize calculation whenlineSpacingset TreeRownow updates its accessibility role with the current selected state.- Issue where deleted Views might not be cleaned up if they are removed from a parent at the same time their child is being removed and added to that same parent.
- Bug where
Viewcould loop when a child is removed and added to its parent - Camera now clips transformed ConvexedPolygons so their points do not go behind it.
- Issue where the children of a
Viewthat is removed are not properly re-added if they are placed into their grandparent before the next cleanup pass withinRenderManagerImpl. - Bug where
View.toAbsoluteandView.fromAbsoluteresulted in incorrect results - Optimize
View.resolvedTransformwith caching - Issue where
TextFieldcould not override user input duringtextChanged nativeTextFieldBehaviorrespectsTextField.cursorVisibleTextInputsettingcursorVisibletotrueduring selection- Slight UI improvement for inset in basic
BasicDropdownBehavior - Issue where
textFieldform element would be considered invalid at creation when blank text is allowed StyledText.isBlanknot working as expectedMonthPanelmore efficiently responds to selection changes, especially when the selection model has a very large dataset.
- Bug where
-
Browser
TreeRolenow marked as aria-multiselectable- Native behavior for
HyperLinks ensure the associated html element inherits the a11y labels of their Hyperlink - Native behavior for
TextFields ensure the associated html element inherits the a11y labels of their TextField - Fixed issue where Native
TextFieldbehavior stopped supporting mask value - Fixed Issue with graphics surface sort order
- Line-height not correctly set when value != 1f
- Bug where zOrder is incorrect for containers
- Only apply Safari shadow hack when multiple shadows applied to an element
- Case where graphics surface index could go negative and create incorrect render ordering
nativeTextFieldBehaviornow properly respectsTextField.cursor- Improved text fitting for
nativeTextFieldBehavior
-
Desktop
- Bug with zIndex for pop-ups
Documentation
- Improving code documentation
- proper external links
- Initial module docs
Versions
- Measured -> 0.3.3
- Dokka -> 1.9.0