Releases: mahozad/wavy-slider
v1.3.0
v1.2.0
Changelog
-
Add a spread / expansion animation on start (along with a new animation spec property to customize it)
If you want the previous behavior, either keep using wavy slider version 1.1.0 or use a
snap
animation spec:WavySlider( animationSpecs = defaultAnimationSpecs.copy( waveStartSpreadAnimationSpec = snap() ), // ... )
For your convenience, an archive of the library artifacts is also available below.
v1.1.0
Changelog
- Updated to Compose Multiplatform 1.6.0
- Added the new overloads that take
SliderState
as argument - Deprecated the
Track
that acceptedvalue
andonValueChange
arguments
You may need to annotate your Composable function that uses the WavySlider
with @OptIn(ExperimentalMaterial3Api::class)
.
Also, please update your Compose Multiplatform to 1.6.0
or newer.
If you encounter problems, keep using WavySlider 1.0.0
.
For your convenience, an archive of the library artifacts is also available below.
v1.0.0
✨ Check out this new multiplatform library for taking screenshot of Composable
s and View
s: Comshot
Changelog
- No code changes compared to version 1.0.0-rc
- Added a link to the source code of squiggly progress in Android 13 media controls in README
For your convenience, an archive of the library artifacts is also available below.
v1.0.0-rc
Changelog
- Apply the
modifier
argument of the WavySlider composable functions - Add an alias for type of wave velocity (i.e.
WaveVelocity
forPair<Dp, WaveDirection>
)
Makes it more readable if you want to use it for function parameters or variable declarations. For example:import ir.mahozad.multiplatform.wavyslider.WaveVelocity fun doSomething( // velocity: Pair<Dp, WaveDirection> velocity: WaveVelocity ) { // var newVelocity: Pair<Dp, WaveDirection>? = null var newVelocity: WaveVelocity? = null newVelocity = 10.dp to TAIL // OR WaveVelocity(10.dp, TAIL) }
- Update Kotlin to 1.9.22
- Update Compose Multiplatform to 1.5.12 (which is based on Compose 1.5.4)
For your convenience, an archive of the library artifacts is also available below.
v0.10.0
If you know how, please help optimize the library by creating an issue or a pull request
(the core of the library is the Base.kt file with just about 200 lines of code).
Changelog
- Fix the bug with wave velocity when its direction is relative (
HEAD
orTAIL
)
When layout direction changed, the wave did not properly change direction according to its animation spec - Fix height calculation when
waveHeight
is negative (less than0.dp
)
Reminder: A negativewaveHeight
is treated like a positive one except with a change in initial wave shift - Add KDoc for default properties (
SliderDefaults.*
)
For your convenience, an archive of the library artifacts is also available below.
v0.9.0
Changelog
- Merge
wavePeriod
andwaveMovement
parameters into a singlewaveVelocity
parameter- It is now more intuitive: a higher
Dp
means faster, a lowerDp
means slower.0
means stop - The speed and direction is now specified as a single argument (like
15.dp to TAIL
) - The speed unit is
Dp
per second - To stop the movement, set speed to zero or a negative value
WaveMovement
was renamed toWaveDirection
, itsSTOPPED
option removed, and other options renamed- The amount of movement is now independent of
waveLength
To make it depend onwaveLength
, simply set the speed towaveLength
or a product of it Dp
(in contrast toDuration
) can be animated withanimateDpAsState
(but you don't need to animate it; see the below entry)
- It is now more intuitive: a higher
- Add ability to provide custom animation spec for wave velocity (using the new
waveVelocityAnimationSpec
ofanimationSpecs
parameter)- Makes it possible to gracefully/gradually change speed/direction of wave movement
- It is applied when the speed or the direction or both are changed
- To get the pervious behavior (immediate/sudden/abrupt change), pass a
snap()
animation spec
- Add support for specifying the value range (with the new
valueRange
parameter) (see #9) - Fix a very subtle bug in Material 2 variant when wave height was animated to more than thumb size
- Add some minor optimizations
For your convenience, an archive of the library artifacts is also available below.
v0.8.0
Changelog
- Rename the wave movement option
AUTO
toBACKWARD
- Add a new
FORWARD
wave movement option - Add a new
STOPPED
wave movement option- You can also set
wavePeriod
to zero to achieve the same thing
- You can also set
- Add ability to provide custom
waveHeight
animation spec (with the newanimationSpecs
parameter)- It even makes it possible to use a different animation spec only for when the slider is interacted with (see #8)
- Rename the parameter
shouldFlatten
toincremental
- Fix the bug when
wavePeriod
is equal to or less thanInt.MIN_VALUE
milliseconds
For your convenience, an archive of the library artifacts is also available below.
v0.7.0
Changelog
- Add ability to change wave movement speed or stop it altogether (using the new
wavePeriod
parameter)- Note that the speed of the wave movement will depend on the
waveLength
- Setting to
0.seconds
or to a duration outside the rangeInt.MIN_VALUE..Int.MAX_VALUE
.milliseconds stops the animation
- Note that the speed of the wave movement will depend on the
- Rename
AnimationDirection
toWaveMovement
- Rename
WaveMovement.UNSPECIFIED
entry toWaveMovement.AUTO
- Make
waveMovement
change smoothly - Provide default values for parameters of the default track used for the Material 3 variant
- Clean and expose default values (you need to import the extension properties)
- Provide default values for Material 2 variant as extension properties on the existing Material 2
SliderDefaults
- Provide default values for Material 3 variant as extension properties on the existing Material 3
SliderDefaults
- Remove
WavySliderDefaults
used for the Material 3 variant
- Provide default values for Material 2 variant as extension properties on the existing Material 2
- Make
trackThickness
parameter non-null- To provide the default value for it either use
SliderDefaults.TrackThickness
or do not pass the argument at all - To hide the track, use
0.dp
or a negative dp
- To provide the default value for it either use
- Reorder parameters of the Composables
For your convenience, an archive of the library artifacts is also available below.
v0.6.0
Changelog
- Re-implement the wave drawing (see the live Web demo). It provides the following improvements:
- The tips of the wave now have a smooth finish and a smooth animation
- When flattened is true, the transition of wave heights is now smooth
- The wave now has the proper height
- The component height is also now accurate
- Update the default values for
waveHeight
andwaveLength
- Update the animation used for
waveHeight
change
For your convenience, an archive of the library artifacts is also available below.