UI to build a Wear OS application. Objectives Build a Wear OS App With Compose UI Using Wear OS specific components With animations What’s the app? Get information about whether or not you should ride your bike to work today at a quick glance with concise information, and nice animations. 2 1 2 3 4
Showing the next days data Adding weather animations What’s next? It’s all fake. Sorry about that. Our “API” gives us: • Weather for the next few days • Amount of rain • Amount of snow • Temperature From it we derive rules that tell us if we can ride or not.
Showing the next days data Adding weather animations What’s next? A simple screen to start. Getting familiar with Compose. We create a ComponentActivity and set its content We create our main layout with different data states and our first Wear OS component We set our actual content, a big white text with a background color based on the ride status
Showing the next days data Adding weather animations What’s next? Using pre-made components Wear OS Material components Using a classic Compose Icon to display the images Using a Chip component to display our data easily Using a ScalingLazyColumn to get the fading lens effect at the top and bottom
Showing the next days data Adding weather animations What’s next? Other components Specifically made for Wear OS Pickers More Chips Sliders and Steppers Page indicators
Showing the next days data Adding weather animations What’s next? Make rain/snow fall Building blocks • Random X between 0 and the edge of the screen • The Y increases with time (that’s the animation!) • Random delay until the drop starts to fall down • Icon of a raindrop or snow flake