在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Ramotion/fluid-slider-android开源软件地址(OpenSource Url):https://github.com/Ramotion/fluid-slider-android开源编程语言(OpenSource Language):Kotlin 93.4%开源软件介绍(OpenSource Introduction):FLUID SLIDER [KOTLIN]A slider widget with a popup bubble displaying the precise value selectedWe specialize in the designing and coding of custom UI for Mobile Apps and Websites.Stay tuned for the latest updates:Inspired by Virgil Pana shot Requirements
Installation Just download the package from here and add it to your project classpath, or just use the maven repo: Gradle: implementation 'com.ramotion.fluidslider:fluid-slider:0.3.1' SBT: libraryDependencies += "com.ramotion.fluidslider" % "fluid-slider" % "0.3.1" Maven: <dependency>
<groupId>com.ramotion.fluidslider</groupId>
<artifactId>fluid-slider</artifactId>
<version>0.3.1</version>
<type>aar</type>
</dependency> Basic usagePlace the To track the current position of the slider, set the
You can also track the beginning and completion of the movement of the slider, using the following properties:
Here is simple example, how to change // Kotlin
val max = 45
val min = 10
val total = max - min
val slider = findViewById<FluidSlider>(R.id.fluidSlider)
slider.positionListener = { pos -> slider.bubbleText = "${min + (total * pos).toInt()}" }
slider.position = 0.3f
slider.startText ="$min"
slider.endText = "$max"
// Java
final FluidSlider slider = findViewById(R.id.fluidSlider);
slider.setBeginTrackingListener(new Function0<Unit>() {
@Override
public Unit invoke() {
Log.d("D", "setBeginTrackingListener");
return Unit.INSTANCE;
}
});
slider.setEndTrackingListener(new Function0<Unit>() {
@Override
public Unit invoke() {
Log.d("D", "setEndTrackingListener");
return Unit.INSTANCE;
}
});
// Or Java 8 lambda
slider.setPositionListener(pos -> {
final String value = String.valueOf( (int)((1 - pos) * 100) );
slider.setBubbleText(value);
return Unit.INSTANCE;
}); Here are the attributes you can specify through XML or related setters:
This library is a part of a selection of our best UI open-source projects. Third Party BindingsReact NativeYou may now use this library with React Native via the module here |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论