Slide 1

Slide 1 text

Unusable or Undebuggable? Rebelling against "best practices"

Slide 2

Slide 2 text

Who is your speaker His name is: Louis CAD • Developed for Android since 2014 • Wears smartwatches since 2015 (Android Wear / Wear OS) • Kotlin lover since 2016 • Does open source since 2016 with Splitties, and other projects • Currently focused on Charts-kt by Data2Viz, a commercial Kotlin Multiplatform charting library (JS, iOS, JVM, & Android of course) • Also doing Wear OS apps, and contributing to OSS projects

Slide 3

Slide 3 text

LazyColumn & basic features The truth that hurts

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

More than 3 years old 💀

Slide 6

Slide 6 text

@Louis_CAD Component: ScalingLazyColumn

Slide 7

Slide 7 text

@Louis_CAD Component: ScalingLazyColumn .com/android/wear-os-samples/issues/238 Jank and poor scrolling performance on the ComposeAdvanced sample

Slide 8

Slide 8 text

@Louis_CAD Reproduced on 3 watches (Samsung, Mobvoi, Google) Unreproducible on the emulator… Component: ScalingLazyColumn .com/android/wear-os-samples/issues/238 Jank and poor scrolling performance on the ComposeAdvanced sample

Slide 9

Slide 9 text

@Louis_CAD Reported in 2022 (12th March) Reproduced on 3 watches (Samsung, Mobvoi, Google) Unreproducible on the emulator… Component: ScalingLazyColumn .com/android/wear-os-samples/issues/238 Jank and poor scrolling performance on the ComposeAdvanced sample

Slide 10

Slide 10 text

@Louis_CAD Reported in 2022 (12th March) Reproduced on 3 watches (Samsung, Mobvoi, Google) Unreproducible on the emulator… Component: ScalingLazyColumn "Closed as completed" within 4 days! 🎉⁉ .com/android/wear-os-samples/issues/238 Jank and poor scrolling performance on the ComposeAdvanced sample

Slide 11

Slide 11 text

@Louis_CAD Reported in 2022 (12th March) Reproduced on 3 watches (Samsung, Mobvoi, Google) Unreproducible on the emulator… Component: ScalingLazyColumn "Closed as completed" within 4 days! 🎉⁉ .com/android/wear-os-samples/issues/238 Jank and poor scrolling performance on the ComposeAdvanced sample

Slide 12

Slide 12 text

Conclusion

Slide 13

Slide 13 text

Conclusion • Don't debug your app on an actual watch? • Enjoy the ergonomics of manipulating a watch emulator with a mouse pointer! • release build: really slower than debug build? (yes)

Slide 14

Slide 14 text

Conclusion, 2 option sets: 1. Unusable or Undebuggable 2. Kinda usable and debuggable

Slide 15

Slide 15 text

Conclusion, 3 option sets: 1. Unusable or Undebuggable 2. Kinda usable and debuggable 3. Hack around

Slide 16

Slide 16 text

Hack around

Slide 17

Slide 17 text

In the mind of a rebel about to hack around Back in 2015 (7-8 years ago), scrolling was smooth on my LG G Watch It doesn't have to be! 
 People need to know. People say RecyclerView is verbose I don't remember RecyclerView being laggy LazyColumn lagging behind RecyclerView? 
 Déjà vu Insertions and removals animations? I wrapped RecyclerView to get them Let's try that thing again?

Slide 18

Slide 18 text

Let's try that thing again?

Slide 19

Slide 19 text

Let's try that thing again? Let's take a step back f irst.

Slide 20

Slide 20 text

@Louis_CAD LazyColumn RecyclerView Simple, high-level API, out of the box 👌 Ok-ish/poor performance in debug mode 😕 @Louis_CAD No insertion/removal animations 😭 Lower-level API, complex by default 🫤 As smooth as its content 🤞 Animates all item changes, by default 😎 Scrolling friction on Samsung GW4 😓 Keeps all user input ✅

Slide 21

Slide 21 text

What if LazyColumn was using RecyclerView under the hood? I heard SwiftUI kinda does that on iOS: Using UITableView for LazyVStack & LazyHStack.

Slide 22

Slide 22 text

@Louis_CAD LazyColumn RecyclerView Simple, high-level API, out of the box 👌 Ok-ish/poor performance in debug mode 😕 @Louis_CAD No insertion/removal animations 😭 Lower-level API, complex by default 🫤 As smooth as its content 🤞 Animates all item changes, by default 😎 Scrolling friction on Samsung GW4 😓 Keeps all user input ✅

Slide 23

Slide 23 text

@Louis_CAD LazyColumnWithRecyclerView Simple, high-level API, out of the box 👌 Ok-ish/poor performance in debug mode 😕 @Louis_CAD No insertion/removal animations 😭 Lower-level API, complex by default 🫤 As smooth as its content* 🤞 Animates all item changes, by default 😎 Scrolling friction on Samsung GW4 😓 Keeps all user input ✅

Slide 24

Slide 24 text

@Louis_CAD LazyColumnWithRecyclerView Simple, high-level API, out of the box 👌 @Louis_CAD As smooth as its content* 🤞 Animates all item changes, by default 😎 Keeps all user input ✅ Let's look at that, top to bottom.

Slide 25

Slide 25 text

@Louis_CAD LazyColumnWithRecyclerView Simple, high-level API, out of the box 👌 @Louis_CAD Let's look at that, top to bottom.

Slide 26

Slide 26 text

@Louis_CAD LazyColumnWithRecyclerView Simple, high-level API, out of the box 👌 @Louis_CAD As smooth as its content* 🤞 Animates all item changes, by default 😎 Keeps all user input ✅ *Some of the lag is caused by missing pro fi le for Composable content… 
 …so we only made the issue less bad… 😶 
 Scrolling the app a bit gets JIT to fi x the issue, until next deploy. 
 Better than nothing!

Slide 27

Slide 27 text

Where is the code today? .com/LouisCAD/Splitties