Karamunting.Android.Ramotion.FluidSlider 0.3.1

💧 A slider widget with a popup bubble displaying the precise value selected

Install-Package Karamunting.Android.Ramotion.FluidSlider -Version 0.3.1
dotnet add package Karamunting.Android.Ramotion.FluidSlider --version 0.3.1
<PackageReference Include="Karamunting.Android.Ramotion.FluidSlider" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Karamunting.Android.Ramotion.FluidSlider --version 0.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Example

// Created by Rofiq Setiawan (rofiqsetiawan@gmail.com)

using Android.App;
using Android.OS;
using Android.Support.V7.App;
using Android.Views;
using Android.Widget;
using Kotlin;
using Ramotion.FluidSliderLib;
using R = FluidSliderDemo.Resource;

namespace FluidSliderDemo
{
	[Activity(MainLauncher = true)]
    public class MainActivity : AppCompatActivity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(R.Layout.activity_main);

            var textView = FindViewById<TextView>(R.Id.textView);

            const int max = 45;
            const int min = 10;
            var total = max - min;

            var slider = FindViewById<FluidSlider>(R.Id.fluidSlider);

            slider.BeginTrackingListener = new Function0<Unit>(
                () =>
                {
                    textView.Visibility = ViewStates.Invisible;
                    return Unit.Instance;
                }
            );

            slider.EndTrackingListener = new Function0<Unit>(
                () =>
                {
                    textView.Visibility = ViewStates.Visible;
                    return Unit.Instance;
                }
            );

            slider.PositionListener = new Function1<Java.Lang.Float, Unit>(
                pos =>
                {
                    slider.BubbleText = pos.FloatValue().ToString("0.00");
					return Unit.Instance;
                }
            );

            slider.Position = 0.52f;
            slider.StartText = min.ToString();
            slider.EndText = max.ToString();
        }
    }
}

Example

// Created by Rofiq Setiawan (rofiqsetiawan@gmail.com)

using Android.App;
using Android.OS;
using Android.Support.V7.App;
using Android.Views;
using Android.Widget;
using Kotlin;
using Ramotion.FluidSliderLib;
using R = FluidSliderDemo.Resource;

namespace FluidSliderDemo
{
	[Activity(MainLauncher = true)]
    public class MainActivity : AppCompatActivity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(R.Layout.activity_main);

            var textView = FindViewById<TextView>(R.Id.textView);

            const int max = 45;
            const int min = 10;
            var total = max - min;

            var slider = FindViewById<FluidSlider>(R.Id.fluidSlider);

            slider.BeginTrackingListener = new Function0<Unit>(
                () =>
                {
                    textView.Visibility = ViewStates.Invisible;
                    return Unit.Instance;
                }
            );

            slider.EndTrackingListener = new Function0<Unit>(
                () =>
                {
                    textView.Visibility = ViewStates.Visible;
                    return Unit.Instance;
                }
            );

            slider.PositionListener = new Function1<Java.Lang.Float, Unit>(
                pos =>
                {
                    slider.BubbleText = pos.FloatValue().ToString("0.00");
					return Unit.Instance;
                }
            );

            slider.Position = 0.52f;
            slider.StartText = min.ToString();
            slider.EndText = max.ToString();
        }
    }
}

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.3.1 66 7/9/2019