# Chris Banes on Medium

Stories by Chris Banes on Medium

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

## AMD Ryzen for Android development

DevFeed: [AMD Ryzen for Android development](<https://devfeed.tech/articles/amd-ryzen-for-android-development-24919.md>)

Original publisher: [Read original article](<https://chrisbanes.medium.com/amd-ryzen-for-android-development-c0b7fc4f1a66?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2021-04-08T09:30:28Z

Content type: article

Language: en

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

Topics: [android-development](<https://devfeed.tech/topics/android-development.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [amd](<https://devfeed.tech/tags/amd.md>), [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [cpu](<https://devfeed.tech/tags/cpu.md>)

### AI overview

The article evaluates a Huawei Matebook 14 with an AMD Ryzen 5 4600H and 16GB of RAM for Android development, comparing its build performance with a 2019 MacBook Pro.

### Source excerpt

AMD Ryzen for Android developmentI bought a new laptop, such fast, much happy. I've recently been in the market for a new laptop for myself. My priorities were: Small enough to be able to sit on the sofa and do my life-admin tasks. Powerful enough to do a bit of development without waiting for the earth to do a complete rotation. The laptop which I was using for these tasks was a Pixelbook i7 16GB. To be honest, I love this laptop for general web-browsing tasks. It's small, it's portable, and the 3:2 screen ratio really works for reading/writing. BUT.... it's slow. Linux on ChromeOS works really nicely, but the laptop just doesn't have enough power for anything even close to what is needed for Android development. My initial thought was a new Macbook Pro 13" with the M1 chip, and it would have been a fine choice, but decided against it because: No option currently for 16GB of RAM. 8GB isn't enough for Android development when you also use emulators. Minor thing, but I use a Macbook Pro 16" for work (more on that below), and wanted to go back to using something non-Mac. Cost. GBP 1300 is more than I wanted to pay for a weekend machine. So, what did I end up... https://medium.com/media/f0018cd4555f47ef991478e90676b341/href I ended up with a Huawei Matebook 14 16GB. Listing out the reasons: Has a AMD Ryzen 5 4600H CPU. That's the faster H chip, not the 4600U which you typically find in ultrabook laptops. 16GB of RAM. 'nuff said. 3:2 screen ratio. This wasn't a requirement, but it really does work well for coding. Cost: GBP 849. I won't turn this post into a sales pitch for the Matebook 14, but this is honestly one of the best laptops I've ever had. Small (but not too small), nice keyboard to type on (as good as the 2019 Macbook), good touchpad. The only downside is that it only has 1 USB-C port, but I can get over that. Android development build times So lets cut to the actual point of this blog post, putting the AMD Ryzen 4600H through it's paces for some Android development. I

## Jetpack Compose -- Before and after

DevFeed: [Jetpack Compose -- Before and after](<https://devfeed.tech/articles/jetpack-compose-before-and-after-24926.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/jetpack-compose-before-and-after-8b43ba0b7d4f?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2020-12-15T13:54:19Z

Content type: comparison

Language: en

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

Topics: [Compose](<https://devfeed.tech/topics/compose.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Android](<https://devfeed.tech/topics/android.md>), [migration](<https://devfeed.tech/topics/migration.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [modules](<https://devfeed.tech/topics/modules.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [build](<https://devfeed.tech/tags/build.md>), [compose](<https://devfeed.tech/tags/compose.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [migration](<https://devfeed.tech/tags/migration.md>), [modules](<https://devfeed.tech/tags/modules.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This article reviews the migration of the Tivi Android app's UI to Jetpack Compose. It compares APK size, build speed, and source line count, and describes how the app's modular structure enabled an incremental migration.

### Source excerpt

Jetpack Compose -- Before and afterHow the build speed, APK size and source line count changed after migrating the Tivi sample app to Jetpack Compose This post has been updated since it was first published, to new include updated stats for Jetpack Compose 1.0.0-rc01. If you would like to see the original version of this post, see here. In 2020, I began the task of slowly migrating the UI in Tivi to be written in Jetpack Compose, and roughly 12 months later it is now complete. 🎉 In this blog post, we'll take a look back and compare a number of key metrics to see how well Compose compares in: APK size, build speed and lines of code. The app Before I go any further into the Compose side of things, let me quickly describe the app. Tivi is pretty heavily modularized, with each UI 'screen' in its own Gradle module (named ui-$NAME). Each of those screens was implemented in a Fragment, and then pieced together using AndroidX Navigation in the main app module. To give you an idea of the structure, here's a graph of the modules in the app: Graph of Tivi's module structure. Generated using Jake Wharton's handy Gradle task Most of the fragments had no knowledge of each other, since the navigation graph was implemented using deep link URIs, ensuring decoupling. Perhaps more importantly, it also allows independent module compilation which aids build parallelism. Note: the module structure of Tivi is not perfect by any means. There are too many dependencies of UI modules (at the top) to base modules (at the bottom). Ideally each layer should be seperated. Something for me to work on. Before I started the migration to Compose, Tivi used all the cool 🌈 UI 💫 things available to Android developers: Data Binding, Epoxy, Material Design Components, Insetter DBX, MotionLayout to name a few. But unfortunately most of these came with a build cost since they use annotation processing. Process of migrating Earlier I mentioned that we had just completed the 'first stage' of the migration, so w

## Dark Theme with MDC

DevFeed: [Dark Theme with MDC](<https://devfeed.tech/articles/dark-theme-with-mdc-24922.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/dark-theme-with-mdc-4c6fc357d956?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2020-08-25T22:01:01Z

Content type: tutorial

Language: en

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

Topics: [Dark Mode](<https://devfeed.tech/topics/dark-mode.md>), [Android](<https://devfeed.tech/topics/android.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [design](<https://devfeed.tech/tags/design.md>), [implement](<https://devfeed.tech/tags/implement.md>), [mad-skills](<https://devfeed.tech/tags/mad-skills.md>), [material-components](<https://devfeed.tech/tags/material-components.md>), [material-design](<https://devfeed.tech/tags/material-design.md>), [quick-start](<https://devfeed.tech/tags/quick-start.md>)

### AI overview

A tutorial on implementing dark themes in Android apps with Material Design Components. It explains the platform's device-wide dark-theme setting, the design and battery considerations, and the initial steps for extending an app theme with Theme.MaterialComponents.DayNight and optionally allowing users to choose the theme mode.

### Source excerpt

Using Material Design Components to implement a dark theme In the previous blog posts, Nick Rout went through the basis of Material Theming, and the pillars of color, typography and shape. Material Theming with MDC: Color Material Theming with MDC: Type Material Theming with MDC: Shape This post is going to build upon that to see how we can adapt our apps to support dark themes. User selectable dark themes were added to the Android platform in Android 10, but that does not mean they're new to app developers. The default theme for Android devices was dark up until Android 5.0 (Lollipop)! The difference last year was that the platform added a device-wide setting. Meaning that the user has additional control over the theme of the device, but also of apps. Alongside the recent device-wide setting, we now also have comprehensive design guidance on material.io, which we will talk about later in this blog post. Why support dark theme? First up, why support a dark theme at all? The Material.io page on Dark Theme has a good summary on some of the technical benefits (emphasis mine): Dark themes reduce the luminance emitted by device screens [...]. They help improve visual ergonomics by reducing eye strain, adjusting brightness to current lighting conditions, and facilitating screen use in dark environments -- all while conserving battery power [for OLED displays]. The most important reason though is that your users want it. The Android team added the system-wide dark theme setting because it consistently came up as a top requested feature by users. Now that I've convinced you to support dark themes in your app, let's look at how you add one... Quick start To add a dark theme to your app, use Material Design Components (MDC) for Android's support: #1: Change your theme You need to change your theme to extend from one of the Theme.MaterialComponents.DayNight themes: <style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight"> <!-- Other theme attributes --></style>#2: Choos

## 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

## Suspending over Views -- Example

DevFeed: [Suspending over Views -- Example](<https://devfeed.tech/articles/suspending-over-views-example-24928.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/suspending-over-views-example-260ce3dc9100?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2019-12-02T08:57:37Z

Content type: tutorial

Language: en

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

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [recyclerview](<https://devfeed.tech/topics/recyclerview.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [callback](<https://devfeed.tech/tags/callback.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [development](<https://devfeed.tech/tags/development.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [recyclerview](<https://devfeed.tech/tags/recyclerview.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

A worked example from the Tivi app shows how coroutines can simplify asynchronous UI operations. It examines a broken episode-expanding animation caused by reused item IDs and views that may not be attached to the RecyclerView.

### Source excerpt

Illustration by Virginia PoltrackSuspending over views -- exampleA worked example from the Tivi app This blog post is the second of two which explores how coroutines enables you to write complex asynchronous UI operations in a much simpler way. The first post goes through the theory, while this post demonstrates how they fix a problem. If you want to recap the first post, you can find it here: Suspending over Views Let's take what we learnt in the previous post and apply it to a real-world app use case. The problem Here we have the TV show details UI from the Tivi sample app. As well as information about the show, it lists the show's seasons and episodes. When the user clicks one of the episodes, the episode's details are displayed using an animation which expands the clicked item: Episode expanding (20% speed) The app uses the InboxRecyclerView library to handle the expanding animation above: https://medium.com/media/af84b36b2b481525fbab682b6a6cffa7/href InboxRecyclerView works by us providing the item ID of view to expand. It then finds the matching view from the RecyclerView items, and performs the animation on it. Now let's look at the issue we're trying to fix. Near the top of the same UI is a different item, which shows the user their next episode to watch. It uses the same view type as the individual episode item shown above, but has a different item ID. To aid development, I was lazy and used the same onEpisodeItemClicked() for this item. Unfortunately this led to a broken animation when clicked. Wrong item expanding (20% speed) Instead of expanding the clicked item, the library expands a seemingly random item at the top. This is not the effect we want, and is caused by some underlying issues: The ID we use in the click listener is taken directly from the Episode class. This ID maps to the individual episode item within the season list. The episode item may not be attached to the RecyclerView. The user would need to have expanded the season and scrolled so th

## Suspending over Views

DevFeed: [Suspending over Views](<https://devfeed.tech/articles/suspending-over-views-24927.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/suspending-over-views-19de9ebd7020?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2019-12-02T07:53:44Z

Content type: tutorial

Language: en

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

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Android](<https://devfeed.tech/topics/android.md>), [Jetpack](<https://devfeed.tech/topics/jetpack.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [performance](<https://devfeed.tech/tags/performance.md>), [recyclerview](<https://devfeed.tech/tags/recyclerview.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This article explains how Kotlin coroutines can simplify asynchronous Android view programming. It describes the callback-heavy Android view system, Jetpack KTX extension functions, and suspending functions that can model UI operations without blocking the main thread.

### Source excerpt

Illustration by Virginia PoltrackSuspending over viewsHow coroutines can make UI programming easier Kotlin Coroutines allow us to model asynchronous problems like synchronous code. That's great, but most usage seems to concentrate on I/O tasks and concurrent operations. Coroutines are great at modelling problems which work across threads, but can also model asynchronous problems on the same thread. There's one place which I think really benefits from this, and that's working with the Android view system. Android views 💘 callbacks The Android view system loves callbacks; like really loves callbacks. To give you an idea, there are currently 80+ callbacks in view and widgets classes in the Android framework, and then another 200+ in Jetpack (includes non-UI libraries, but you get the idea). Commonly used examples include: AnimatorListener to know when an animator finishes. RecyclerView.OnScrollListener to know when the scroll state changes. View.OnLayoutChangeListener to know when a view is laid out. Then there are the APIs which accept a Runnable to perform an async action, such as View.post() or View.postDelayed(), etc. There are so many callbacks because user interface programming on Android is inherently asynchronous. Everything from measure & layout, drawing, to inset dispatch are all performed asynchronously. Generally, something (usually a view) requests a traversal from the system, and then some time later the system dispatches the call, which then triggers any listeners. KTX extension functions For a lot of the APIs we've mentioned above, the team has added extension functions in Jetpack to improve the developer ergonomics. One of my favorites is View.doOnPreDraw(), which greatly simplifies waiting for the next draw to happen. There are many others which I use every day: View.doOnLayout() and Animator.doOnEnd() to name two. But these extension functions only go so far: they make a old-school callback API into a Kotlin-friendly lambda-based API. They're nicer t

## Gesture Navigation: Handling gesture conflicts (III)

DevFeed: [Gesture Navigation: Handling gesture conflicts (III)](<https://devfeed.tech/articles/gesture-navigation-handling-gesture-conflicts-iii-24923.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/gesture-navigation-handling-gesture-conflicts-8ee9c2665c69?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2019-10-17T00:09:31Z

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>), [navigation](<https://devfeed.tech/topics/navigation.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [gesture-navigation](<https://devfeed.tech/tags/gesture-navigation.md>), [gestures](<https://devfeed.tech/tags/gestures.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [music-player](<https://devfeed.tech/tags/music-player.md>), [screen](<https://devfeed.tech/tags/screen.md>), [ux](<https://devfeed.tech/tags/ux.md>)

### AI overview

This third post in a series explains how Android 10 system gestures can conflict with app gestures near screen edges. It uses examples such as music-player SeekBars, navigation drawers, carousels, sliders, and swipe actions, and introduces a flow chart for choosing a solution.

### Source excerpt

Cover image by Virginia PoltrackGesture Navigation: handling gesture conflicts (III) This is the third post in our series on Gesture Navigation. If you want to skip to another post, you can find them listed below: Gesture Navigation: Going edge-to-edge (I) Gesture Navigation: Handling visual overlaps (II) Gesture Navigation: Immersive Modes (IV) The previous post marks the end of us talking about drawing to the edges. In this third post we're going to cover how to handle any gesture conflicts, between your app and the new system gestures in Android 10. What do we mean by gesture conflicts? Let's take a look at an example. Here we have a music player app, which allows the user to scrub through the current song by dragging a SeekBar. Unfortunately, the SeekBar is too close to the home gesture area resulting in the system quick-switch gesture taking over and confusing the user. The same thing can happen on any of the screen edges with gesture areas. There are plenty of common examples which can cause conflicts, such as: Navigation drawers (DrawerLayout), carousels (ViewPager), sliders (SeekBar), swipe actions on lists. Which brings us onto the question of 'how can we fix this?'. To help with this question, we've created a flow chart to help guide to one of the solutions. You can find a printable PDF version of the flow chart here. Hopefully the questions are self-explanatory, but in case you're not sure on any of them, let's explain each of them: 1. App required to hide navigation and status bars? The first question is asking if your app's main use case requires hiding of the navigation and/or status bars. By hiding we mean that they those system bars are not visible at all. It does not mean that you've made your app go edge-to-edge, or similar. Possible reasons for answering yes to this question are: You use the FLAG_FULLSCREEN WindowManager flag. Note, this can also be done via the android:windowFullscreen theme attribute, or extend from one of the Theme.XXX.Fullscre

## Gesture Navigation: Immersive Modes (IV)

DevFeed: [Gesture Navigation: Immersive Modes (IV)](<https://devfeed.tech/articles/gesture-navigation-immersive-modes-iv-24925.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/gesture-navigation-immersive-modes-43f2d37a925d?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2019-10-16T13:01:02Z

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>), [navigation](<https://devfeed.tech/topics/navigation.md>), [android-apps](<https://devfeed.tech/topics/android-apps.md>), [Playback](<https://devfeed.tech/topics/playback.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [apps](<https://devfeed.tech/tags/apps.md>), [gesture-navigation](<https://devfeed.tech/tags/gesture-navigation.md>), [image](<https://devfeed.tech/tags/image.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [playback](<https://devfeed.tech/tags/playback.md>), [ux](<https://devfeed.tech/tags/ux.md>)

### AI overview

This fourth post in a gesture-navigation series explains Android immersive mode for apps that need to draw fullscreen while hiding system bars. It distinguishes non-sticky and sticky immersive modes, describes their system-bar states, and discusses non-sticky mode for fullscreen video playback and photo viewers.

### Source excerpt

Cover image by Virginia PoltrackGesture Navigation: immersive modes (IV) This is the fourth post in our series on Gesture Navigation. If you want to skip to another post, you can find them listed below: Gesture Navigation: Going edge-to-edge (I) Gesture Navigation: Handling visual overlaps (II) Gesture Navigation: Handling gesture conflicts (III) In this fourth post, we're going to cover what you can do if your app needs to draw across the entire screen, with the system bars hidden. Referring back to our flowchart from the previous post, we're going to cover the remaining two solutions on the right hand-side of the chart. You can find a printable PDF version of the complete flow chart here. The solutions here are to use the immersive mode which the Android platform offers apps. But what is immersive mode? What is immersive mode? Immersive mode is a way to render content fullscreen, hiding the system bars so they are not in the way. It additionally provides safety from accidental gestures/presses causing the user to leave the app, particularly useful for games. There are two types of immersive modes: Non-sticky (normal) immersive mode -- A user can exit immersive mode, by swiping in the system bars. Sticky immersive mode -- A user can temporarily exit immersive mode by swiping in the system bars. Immersive mode is automatically re-entered after a short time (few seconds). For both modes, there are two states: System bars hidden -- in this state the home and back gestures are disabled. The user must first swipe from an edge to bring in the system bars. System bars showing -- in this state the home and back gestures work as normal. Now that we've gone over the background on immersive mode, let's take a look at the two different modes in detail. Immersive mode: non-sticky As you might have seen from the flow chart, non-sticky immersive mode is ideal for UIs which need to be fullscreen, but do not require precise swiping gestures near the screen edges. Common examples includ

## Gesture Navigation: Handling visual overlaps (II)

DevFeed: [Gesture Navigation: Handling visual overlaps (II)](<https://devfeed.tech/articles/gesture-navigation-handling-visual-overlaps-ii-24924.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/gesture-navigation-handling-visual-overlaps-4aed565c134c?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2019-08-07T22:58:22Z

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>), [navigation](<https://devfeed.tech/topics/navigation.md>), [ui](<https://devfeed.tech/topics/ui.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [gesture-navigation](<https://devfeed.tech/tags/gesture-navigation.md>), [gestures](<https://devfeed.tech/tags/gestures.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial explains how Android developers can use insets to prevent app views from being obscured by system UI when using edge-to-edge layouts. It introduces system UI and inset types, including system window insets, and describes how they help resolve visual conflicts with navigation bars, status bars, and the on-screen keyboard.

### Source excerpt

Cover image by Virginia PoltrackGesture Navigation: handling visual overlaps (II) This is the second post in our series on Gesture Navigation. If you want to skip to another post, you can find them listed below: Gesture Navigation: Going edge-to-edge (I) Gesture Navigation: Handling gesture conflicts (III) Gesture Navigation: Immersive Modes (IV) In part 1 of this series, we explored how you can make your app go 'edge-to-edge'. Unfortunately this can result in some of your views being drawn behind the system bars, obscuring them from the user. This post explores how we can inset those views, moving them away from the system bars. For the rest of this post I'll be referring to something called the 'system UI'. This is what we call any of the system provided UI on screen, such as the navigation bar and status bar. It also includes things like the notifications panel. Insets The term insets tends to strike fear into Android developers, usually from their experience trying to draw behind the status bar in the days of Android Lollipop. For example, this very old StackOverflow question on the topic has a lot of views 😲. Insets tell you which parts of the screen intersect with the system UI, like the navigation or status bar. Intersecting could mean simply being displayed above your content, but it can also tell you about system gestures too. We can use the insets to try and remove any conflicts, for example by moving a view in from the edges. On Android, insets are represented by the WindowInsets class, and WindowInsetsCompat in AndroidX. With Android Q, we have 5 types of insets to consider when laying out your app. Which inset type you use depends on the situation you're in, so let's go through each type and look... System window insets Method: getSystemWindowInsets() System window insets are the most common type of insets in use today. They have been around since API 1 in various forms, and are dispatched to the view hierarchy whenever the system UI is displayed above yo