One of the new features announced at WWDC this year was Live Text. It allows users to select, translate, and search for text found within any image. The demo used during the keynote was a meeting whiteboard with handwritten text. Opening the camera app on iPhone and pointing it at the whiteboard, a small indicator appears in the bottom right corner showing text is recognized in the viewfinder.
This is an extension of my last Compose CameraX on Android article. If you want to know how to set up a preview with Jetpack compose and CameraX, you can check my previous article here. This post will describe how to use the image capture and analysis feature with the machine learning (ML) library to build a smart CameraX. User can use a hand gesture to trigger the image capture action and display the captured image.
Android new UI toolkit Jetpack compose is in beta now, which has all the features you need to build production-ready apps. CameraX is another Jetpack support library, which let you control the camera easier.
As compose is still under development, lots of the views are still not available the compose way. At the moment there isn’t any official Composable function for CameraX so we have to inflate the legacy android view inside compose. In this post, I will describe a common way to use CameraX in Jetpack compose. …
When building mobile User Interfaces (UIs), it is common to only think of the UIs in the App you are building. However, the App UIs are not standalone on the mobile screen, they are integrated with the system UI. As you can see from the above screenshots, you can feel UIs in the second and fourth screenshots are linked, and blend together, as opposed to a break between the notch and the UI, which also placing emphasis on an app’s content instead of its structure.
We all love Kotlin, Google has chosen it as the first-class language for Android development and the ASOS Android team consider it the only language for new feature implementation.
Since Kotlin is so good, it begs the question of whether we need to consider Java any more? Google has a specific page regarding the Java 8 support on Android Studio and Jake Wharton has written a useful blog piece regarding Java 8 support on Android. With the D8 desugars, Java 8 features lambda, default method and method references which are fully supported for all Android API versions. But some Java…
Kotlin 1.3 was released recently with a ton of new features and functionalities. One of the new features introduced is the inline class declaration (still in experimental). As more data types are introduced in Kotlin, this intrigued me enough to check how they look in Java world. In this post, I would like to go through the data types in Kotlin and show you the corresponding Java implementations.
The following Java classes are converted by IntelliJ Kotlin ByteCode decompiler, with inline/optimization and JVM 8 target option selected. …
Last week, we released a new feature to our customers in our Android App: Boards, which lets our customers group their favourite items. Since users can save up to 500 items for each board, we wanted them to be able to edit the items in batches. In our design, when the user clicks the ‘edit’ button or long presses one Saved Item, the screen transitions into the edit mode. In this mode, the user can select multiple products to add/remove in one batch operation. During development, we found that ActionMode is a perfect fit for this purpose. Here is an…
Since Google officially announced Kotlin as a first-class language for Android in 2017, here at the Android team @ASOS, we were really excited to use it. Data classes are a great feature of Kotlin. They remove the need to manually implement lots of boilerplate code, such as
equals(), hash(), toString().
When using data classes you would assume
equals(), hash(), toString()will work as expected but this is not always the case.
Let’s take the following data class, which holds a
String and an
data class NumArray(val name: String, val values: IntArray)
Consider the Java equivalent of the above data class: