valueFrom, valueTo property is currently actual value on slider
setValues(): initate range slider. (optional) ValueFromvalueTo parameters indicate start position.
OnValueChangeListener notify registered lisetner when value changed.
// smooth slider
slider.setValues(
values =listOf(0f, 100f),
valueFrom = initailValueFrom,
valueTo = initialValueTo
)
// flexible slider
slider.setValues(
valuse =listOf(0f, 10f, 20f, 30f, 50f, 100f, 150f, 200f),
valueFrom = initialValueFrom,
valueTo = initialValueTo
)
slider.valueFrom // actual value from range
slider.valueTo // actual value from range
slider.addOnValueChangeListener { from, to state ->when (state) {
// Called when dragging to thumbValueChangeState.Dragging-> updateValue(from, to)
// Called when update values or take off thumbValueChangeState.Idle-> {
updateValue(from, to)
fetchValueChange(from, to)
}
}
}
License
Copyright 2021 PRNDcompany
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
A customizable, easy-to-use, and functional circular time range picker library for Android. Use this library to mimic Apple's iOS or Samsung's bedtime picker.
image slider supporting indicator and auto scroll with clicking on image to open full screen image slider swipe and pinch zoom gestures like gallery,just pass your images and the position of the current image.