Code Monkey home page Code Monkey logo

Comments (5)

edgar-zigis avatar edgar-zigis commented on May 30, 2024

Yeah, I get what you want. Probably Google Assistant (or which integration you use) can't cope with such multiple minor value changes. For this particular reason I did create delegationMode variable so you could get immediate result or just after you finish sliding.

I will put a setting to immediate, so you could set it like delegationMode = .immediate(granularity: 100) (with default == 1).

But just in case, you can reach the same effect with RxSwift:

private let progressValue = Variable<Int>(0)

gaugeSlider.onProgressChanged = { [weak self] progress in
    self?.progressValue?.value = progress
}

progressValue.asObservable()
    .skip(1)
    .throttle(0.15, scheduler: MainScheduler.instance)  //  depending on throttle value you will get different interval
    .distinctUntilChanged()
    .subscribe({ (value) in
        //  do whatever you want with value
    }).disposed(by: disposeBag)

from gaugeslider.

tnmendes avatar tnmendes commented on May 30, 2024

My goal with granularity to improve the user usability, special the final part of the slide after 8930 sometimes is a bit tricky to reach the 9000.

Yah add a new parameter to .immediate that sounds nice :)

from gaugeslider.

tnmendes avatar tnmendes commented on May 30, 2024

IMG_2750

from gaugeslider.

edgar-zigis avatar edgar-zigis commented on May 30, 2024

@tnmendes released under version 1.2.1
Just use delegationMode = .immediate(interval: 1000)

from gaugeslider.

tnmendes avatar tnmendes commented on May 30, 2024

Thank you!!! 👍

from gaugeslider.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.