Android developers are familiar with accessibility APIs like contentDescription
in the View framework to provide accessibility frameworks like TalkBack additional information about our applications. How do we do this in Compose?
The answer to that lies in the semantics APIs, which support both accessibility services and testing.
This is the first of two articles that explore the semantics framework. Today we will be taking a high level look at what semantics are and why we need them.
Uncaught exceptions fail JUnit tests, just as we would expect. An uncaught exception in our code will crash the application, so we’d rightfully want uncaught exceptions to fail our unit tests too!
We might also expect that an uncaught exception in an RxJava chain would fail our unit tests. These exceptions cause crashes when they go to the default error handler, so they should fail our tests too, right?
Unfortunately that is not the case.
Shape is an important component of Material Design, and the Material Design Components library for Android supports shape theming on many of the Views that it offers. I recently found myself struggling to get my bottom sheets to show rounded corners though. Here’s a guide to getting your bottom sheets shaped properly!
View Binding is a fantastic new tool for Android Developers to interact with their layouts. As a refresher, View Binding helps replace findViewById()
calls, KotlinX synthetic view accessors, and Butterknife with a solution that is null-safe, View type-safe, and directly tied to your layout files. View Binding was actually split off from the Databinding plugin, which has been stable and used in production apps for a couple years now.
Many applications use <include>
tags in their layout files and as developers start migrating to View Binding they will need to watch out for conflicting View IDs in their included layouts.
I often seen projects that use some sort of custom Gradle configuration to set up signing their APK/AAB for release. Most of the time this involves a file or custom command line arguments that provide extra Gradle project properties that the app’s build.gradle references in a signingConfigs
block.
The Android Gradle Plugin already has a mechanism for you to provide an alternative signing configuration at run time, so you don’t need to set this up yourself!