Thread
#compose-wear
    Garan Jenkin

    Garan Jenkin

    9 months ago
    This is what I added - probably an abuse of the Stepper 🙂 but having both the min and max on one screen felt right, especially as min < max condition is enforced. Two things I noted: • At 2s and 17s is that there is the occasional flicker of a value that isn't either ending 0 or 5, but is instead 4 or 9, before it gets corrected. Highly likely I'm doing something wrong, but I wonder if you've seen this too @Steve Bower [G]? nb. only saw this on the emulator, not on real devices. • Is it planned that the stepper can use the bezel for + and - input? (Or did I fail to configure that, but it's already possible?). (My Stepper use: https://github.com/garanj/wearwind/pull/6/files#diff-bd7e769b499a685bcb1751d4b829ca03039076cb994ee52d5086f17a441703c5 )
    John Nichol

    John Nichol

    9 months ago
    Regarding flicker @Michail Kulaga can you take a look please?
    Regarding plans for the stepper to use the bezel, @Sergio Sancho can probably add more color, but yes we are working towards adding bezel and rolling side button support to scrolling and stepper type controls.
    louiscad

    louiscad

    9 months ago
    Would the bezel swipe be supported only on some watches like the Galaxy Watch 4, or on all watches? Or maybe WearOS version dependent?
    Michail Kulaga

    Michail Kulaga

    9 months ago
    @Garan Jenkin Most definitely this issue is related to the float math which is used inside and which is unfortunately not perfect and can cause not-precise results .https://betterprogramming.pub/why-is-0-1-0-2-not-equal-to-0-3-in-most-programming-languages-99432310d476
    But to be sure let me check how you show values and round them up..
    Yep, in
    SettingsDetail.kt:80
    you’re using
    toInt()
    method, which rounds up a fraction part towards zero. For example a float number 109.999998 will be rounded up to 109. A much better approach is to use
    roundToInt()
    method, which rounds float numbers to closest integer - so 109.99998 will be rounded up to 110. Usage of
    roundToInt()
    instead of
    toInt()
    should eliminate this problem
    y

    yschimke

    9 months ago
    Any chance of adding Int support to avoid these types of issues? p.p.
    Nice work @Garan Jenkin on removing ConstraintLayout, Is it still needed for Connect Screen?
    Garan Jenkin

    Garan Jenkin

    9 months ago
    Yeah @yschimke it's Todo... Soon!
    Awesome thanks @Michail Kulaga I had no idea about this
    Michail Kulaga

    Michail Kulaga

    9 months ago
    @yschimke yeah, adding an Int api might be a part of solution
    John Nichol

    John Nichol

    9 months ago
    @louiscad It would depend on the device - if a device has a bezel (mechanical or virtual) or a rolling side button it would work and should work across all Wear OS version as Compose for Wear OS supports API 25+
    louiscad

    louiscad

    9 months ago
    So it doesn't emulate virtual bezel?
    Sergio Sancho

    Sergio Sancho

    9 months ago
    I don't think we will do virtual bezel emulation in Wear Compose. Ideally, it has to be done consistently across apps in WearOS.
    And yes, we plan to support RSB/Bezel on the Stepper