https://kotlinlang.org logo
g

Garan Jenkin

12/07/2021, 10:33 AM
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 )
j

John Nichol

12/07/2021, 10:36 AM
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.
🆒 1
l

louiscad

12/07/2021, 12:33 PM
Would the bezel swipe be supported only on some watches like the Galaxy Watch 4, or on all watches? Or maybe WearOS version dependent?
m

Michail Kulaga

12/07/2021, 2:35 PM
@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
👍 1
mind blown 2
y

yschimke

12/07/2021, 3:08 PM
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?
g

Garan Jenkin

12/07/2021, 3:12 PM
Yeah @yschimke it's Todo... Soon!
Awesome thanks @Michail Kulaga I had no idea about this
🙌 1
m

Michail Kulaga

12/07/2021, 3:26 PM
@yschimke yeah, adding an Int api might be a part of solution
j

John Nichol

12/07/2021, 5:16 PM
@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+
l

louiscad

12/07/2021, 7:01 PM
So it doesn't emulate virtual bezel?
s

Sergio Sancho

12/09/2021, 1:12 PM
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
👍🏻 1
2 Views