Alex Vanyo (he/him)

Android Developer Relations Engineer @ Google, opinions are my own.

When not working with insets, I also like to write code testing code-writing code.

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-09-17

@commonsguy @gakisstylianos the slot lifecycle issue is a really tricky one. The next release of github.com/slackhq/compose-lin will have a new lint rule that should warn against some cases like this one which will lead to losing state.

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-09-16

Random PSA for anyone commonizing Compose code and utilizing lint checks like the built-in ones and github.com/slackhq/compose-lin.

Without extra work, those checks won't apply to common sources, so stuff that you thought lint would catch might have slipped through.

The extra configuration needed, based on AndroidX's setup and github.com/slackhq/slack-gradl:

github.com/alexvanyo/composeli

#JetpackCompose #AndroidDev

Alex Vanyo (he/him) boosted:
Code with the Italians 🀌codewiththeitalians@androiddev.social
2024-07-03

πŸš€ Tune in for Episode 125 on cwti.link/twitch as Alex Vanyo and Ian Clifton from Google dive into design, large screens, and Material3! Don't miss these expert insights! #AndroidDev #MaterialDesign

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-05-22

@gakisstylianos Because the configuration values depended on the insets, a lot of strange edge cases show up, especially around almost square windows.

It has been possible that Configuration.orientation is portrait, but Configuration.screenWidthDp > Configuration.screenHeightDp.

It's also been possible that rotating a device would always report a landscape Configuration.orientation.

This will affect qualified resource resolution, but it should be in an overall positive way.

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-05-21

Android 15 will have a tweak to Configuration values that is a great long-term change, especially in combination with edge-to-edge.

Previously, the Configuration's values were smaller than the overall window size by an amount of insets.

Once an app targets API 35 in Android 15, those values will now more closely match the actual window size, and include the space that is taken up by insets.

developer.android.com/about/ve

#AndroidDev

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-04-01

Circles and stars are great and all, but sometimes designs call for a shape that can create an aperioidic tiling.

With this new change to androidx graphics-shapes, you can create a shape from the hat-turtle continuum to get the einstein tile you need!
android-review.googlesource.co

#androiddev

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-02-27

@zachklipp at least now you can say you started a one-pager!

Alex Vanyo (he/him) boosted:
2024-01-24

@alex_vanyo this is going to make it so much easier to test for accessibility!!

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-01-24

Size is my favorite one:

DeviceConfigurationOverride(
DeviceConfigurationOverride.ForcedSize(DpSize(1280.dp, 800.dp))
) {
MyScreen() // will be rendered in the space for 1280dp by 800dp without clipping
}

Through a bit of trickery by overriding the density, MyScreen() will be guaranteed to have 1280dp by 800dp space to render, regardless of the actual device size.

You can test layouts big and small on a single test device!

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-01-24

Want to test a component with an increased font scale?

DeviceConfigurationOverride(DeviceConfigurationOverride.FontScale(1.5f)) {
MyComponent()
}

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-01-24

Want to test a component in right-to-left?

DeviceConfigurationOverride(DeviceConfigurationOverride.LayoutDirection(LayoutDirection.Rtl)) {
MyComponent() // will be rendered with a right-to-left layout direction
}

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-01-24

New Compose testing API just dropped in 1.7.0-alpha01!

`DeviceConfigurationOverride` is the successor to accompanist/test-harness and allows locally overriding aspects of the device's configuration for @Composable content under test.

Font scale, font weight, dark mode, locale, layout direction, and size are all device-wide properties, so it's difficult to test for them (updating system settings from a test is not fun), but they're also super important to test for!

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-01-19

It's finally happening!

With the GitHub Actions runner releases this week (github.blog/2024-01-17-github-) the default, non-large Linux runners now seem to all support KVM, which means you can replace using macOS runners to run emulators on CI by following these steps: github.blog/changelog/2023-02- (that blog refers to the large Linux runners specifically, but now those steps work on the non-large ones too!)

And as a bonus, the Linux ones appear to be way faster.

github.com/android/nowinandroi

#AndroidDev

Alex Vanyo (he/him) boosted:
Code with the Italians 🀌codewiththeitalians@androiddev.social
2024-01-12

πŸ“… New Episode Alert! On Jan 31st, join us and @alex_vanyo, Android Dev Relations Engineer at Google, for a live session on enhancing our app with an expanding panel. Don't miss this hands-on experience! #AndroidAppDevelopment #TechTalks

Alex Vanyo (he/him) boosted:
Code with the Italians 🀌codewiththeitalians@androiddev.social
2024-01-12

πŸ› οΈ Exciting news! On the 31st, @alex_vanyo joins us for an in-depth live coding session. We're adding an expanding panel to our app and you can watch (and learn) how it's done! Set a reminder now. #CodingLive #AndroidExpertise

Alex Vanyo (he/him) boosted:
2024-01-06

Starting 2024 by saying that I love love the testing APIs in Compose UI. They're so well written that I've rediscovered how enjoyable it is to write UI tests for my projects.

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2024-01-02

Whack-a-mole bugs are so fun to deal with.

A fix to one bug causes a different bug, fixing that causes another one, and then fixing that causes the first to show up again but in an ever-so-slightly different way that slips through the initial regression test...

Alex Vanyo (he/him) boosted:
2023-12-21

Robolectric Native Graphics (through roborazzi) is also good. It hasn't been *super* stable in my experience with a couple of weird native crashes, is harder to set up and is slightly slower than paparazzi, but it's still absolutely better than having no tests.

Alex Vanyo (he/him) boosted:
2023-12-21

If you're publishing a UI library, it's hard to trust your code if your project does not include screenshot tests.

Please spend an hour to set up paparazzi or something? It'll only take a few lines of code to prevent potential regressions for the rest of your project's lifetime.

cashapp.github.io/paparazzi/

Alex Vanyo (he/him)alex_vanyo@androiddev.social
2023-12-18

By requiring a commit of the new version if anything changes, you can verify in code review if a newly added feature requirement is intentional (and as a bonus: it also outputs a lot more, like declared permissions!). With that, even if you currently don’t have unnecessary required features, you can avoid regressing availability which can result in a painful situation where users on some device are stuck on a version of the app if the new version is no longer compatible.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst