# 11weeksofandroid

Published articles for 11weeksofandroid.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Animating your keyboard: Reacting to inset animations

DevFeed: [Animating your keyboard: Reacting to inset animations](<https://devfeed.tech/articles/animating-your-keyboard-reacting-to-inset-animations-24921.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/animating-your-keyboard-reacting-to-inset-animations-839be3d4c31b?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2020-08-24T18:46:01Z

Content type: tutorial

Language: en

Sources: [Chris Banes on Medium](<https://devfeed.tech/sources/chris-banes-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [API](<https://devfeed.tech/topics/api.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [11weeksofandroid](<https://devfeed.tech/tags/11weeksofandroid.md>), [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [animation](<https://devfeed.tech/tags/animation.md>), [api](<https://devfeed.tech/tags/api.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>)

### AI overview

This tutorial explains how to create smoother keyboard animations in Android 11 using the WindowInsetsAnimation and WindowInsetsAnimation.Callback APIs. It contrasts the seamless movement available on Android 11 with the state-snapping behavior on Android 10 and earlier, then walks through implementing the callback and updating a view during the animation.

### Source excerpt

Illustration by Kiran PuriAnimating your keyboard (part 2): reacting to WindowInset animationsCreating seamless keyboard animations using WindowInsetAnimation In the previous blog post, we covered all of the changes to the APIs related to going edge-to-edge: Animating your Keyboard In this blog post we move forward on with the actual task of animating the keyboard. To demonstrate what is possible, here you can see an example of the same app, running on Android 10 on the left, and Android 11 on the right (at 20% speed): On devices running Android 10 and before, when the user clicks on the text input to type a reply, the keyboard animates into place, but the app snaps between the states. This is the behaviour you've seen on your devices for a while, it's just easier to see at 20% speed. On the right you can see the same scenario running on Android 11. This time when the user clicks on the text input, the app moves with the keyboard, creating a more seamless experience. So how can you add this experience to your app? Well it's all powered by some new APIs... WindowInsetsAnimation The API which powers this in Android 11 is the new WindowInsetsAnimation class, which encapsulates an animation involving insets. Apps can listen to animation events through the WindowInsetsAnimation.Callback class, which can be set on a view: https://medium.com/media/5b45d5c8a5e3c6fe2ad82d212d56713e/href So let's just a look at the callback class, and the functions it provides: Imagine that the keyboard is currently closed, and the user has just clicked on an EditText. The system is now about to start showing the keyboard, and since we have a WindowInsetsAnimation.Callback set, we'll receive the following calls in order: https://medium.com/media/8d0b05394ee10940a70775bc554ab192/href So that's how the callback works in theory, now let's apply it to a scenario... Implementing the example We're going to use WindowInsetsAnimation.Callback to implement the example which you saw at the beginning of thi

## Animating your Keyboard

DevFeed: [Animating your Keyboard](<https://devfeed.tech/articles/animating-your-keyboard-24920.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/animating-your-keyboard-fb776a8fb66d?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2020-08-24T16:43:24Z

Content type: article

Language: en

Sources: [Chris Banes on Medium](<https://devfeed.tech/sources/chris-banes-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [11weeksofandroid](<https://devfeed.tech/tags/11weeksofandroid.md>), [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [animation](<https://devfeed.tech/tags/animation.md>), [api](<https://devfeed.tech/tags/api.md>), [gesture-navigation](<https://devfeed.tech/tags/gesture-navigation.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This first article in a series explains how Android 11 apps can prepare for animated on-screen keyboard transitions by adopting edge-to-edge layouts and related WindowInsets API changes. It introduces a three-step approach: going edge-to-edge, reacting to inset animations, and optionally driving those animations.

### Source excerpt

Illustration by Kiran PuriAnimating your keyboard (part 1)New WindowInsets APIs for checking the keyboard (IME) visibility and size New in Android 11 is the ability for apps to create seamless transitions between the on screen keyboard being opened and closed, and it's all powered by lots of improvements to the WindowInsets APIs in Android 11. Here you are two examples of it in action on Android 11. It has been integrated into the Google Search app, as well as the Messages app: Two examples of keyboard animations in Android 11: Google Search app (left), Messages (right) So let's take a look at how you can add this sort of experience to your apps. There are three steps: First, we need to go edge-to-edge. The second step is for apps to start reacting to inset animations. And the third step is by apps taking control of and driving inset animations, if it makes sense for your app. Each of these steps follow on from each other, so we'll cover each in separate blog posts. In this first post, we'll cover going edge-to-edge, and the related API changes in Android 11. Going edge-to-edge Last year we introduced the concept of going edge to edge, as a way for apps to make the most of the new gestural navigation in Android 10: Gesture Navigation: Going edge-to-edge (I) As a quick re-cap, going edge to edge results in your app drawing behind the system bars, like you can see on the left. To quote myself from last year: By going edge-to-edge, apps will instead be laid out behind the system bars. This is to allow your app content to shine through to create a more immersive experience for your users.So what has going edge to edge got to do with the keyboard? Well going edge to edge is actually more than just drawing behind the status and navigation bars. It's apps taking responsibility for handling those pieces of system UI which might overlap with the app. The two obvious examples being the status bar and navigation bar, which we mentioned earlier. Then we have the on-screen-keybo