-
Android Developer Nanodegree enrollment closes soon!
Just a quick notice that entry to Udacity’s Android Developer nanodegree closes in around 32 hours after this post is published!
-
Using StickyLayoutManager to give your RecyclerView sticky headers
Once you’ve created a RecyclerView with headers and content, it’s often useful to have the headers “sticky”. Sticky headers will display over the top of your content, and help your app’s users keep track of which section they are currently in.
-
Creating a RecyclerView with multiple content types and layouts in Kotlin
RecyclerViews are a little bit complicated to get started with, but almost every app has one or two of them somewhere. One of the first problems you may encounter when using them is their lack of a built-in way to handle multiple content types. Creating and binding a single layout is very straightforward, but multiple layouts requires a slightly more complex setup.
-
Adding a variable to both the Android Manifest and Build Config
Whilst it is possible to set a variable in your AndroidManifest.xml using manifestPlaceholders and setting the value in your build.gradle, it can often be useful to access these values in your code too. For example, I recently used this post’s technique to define a deep link path (defined in the manifest) and check the url’s path at runtime (checked in the code).
-
Saving and restoring a RecyclerView's position in Android
When using a RecyclerView in your Android app, especially one with many (or infinite) items inside it, your users will get pretty frustrated if you fail to remember their position.
-
Using break strategy to fix unusual Android TableRow text wrapping issues
An easy way of creating simple, aligned layouts in XML is using a TableLayout and TableRows. This works excellently for most situations, but unfortunately has a few quirks when it comes to handling TextView text wrapping. Recently a bug report was received where very long emails addresses weren’t displayed correctly, and flowed offscreen.
-
Accessing a deep link intent's data / URL in a fragment with AndroidX
Usually, accessing the data associated with a deep link intent in an Activity is just a case of calling intent.data. Easy!
-
An introduction to the NASA APOD API
NASA’s Astronomy Picture of the Day API is an amazing service providing free, reliably sourced space images. However, the official documentation can be a little lacking, hopefully this post will improve on it somewhat.
-
Creating custom stacked icons with FontAwesome
FontAwesome is an excellent resource for web developers, providing almost 1500 icons for free. Whilst these are often enough for your use case, sometimes additional icons are needed. For example, on my portfolio I wanted a square icon for each social media service, but only 6 out of 10 services had a square icon available!