Sign in

Google Developer Expert & Android Engineer at @Over . South Africa. ZA. I write more here — https://riggaroo.co.za
Photo by Te Pania Noonan on Unsplash

What is an inline class? 🧐

An inline class is a special type of class defined in Kotlin that only has one property. At runtime, the compiler will “inline” the property where it was used. This is similar to inline functions, where the compiler inserts the contents of the function into where it was called.

Example without inline classes 🕵🏻‍♀️

For instance, we have two classes — Recipe and Ingredient, which both use a UUID as the type to represent the ID of the instance. When creating a new Ingredient class, it can be quite easy to pass the incorrect ID to the Ingredient class. …


Photo by James Pond on Unsplash

Day-to-day tasks as an Android Developer can consist of varying jobs to complete your work effectively. Whether it is making sure your network requests are correct or ensuring pixel-perfect screens, there are a few tools that have made my day-to-day development easier. These are some of my favourites:

Vysor

Vysor is my go-to tool for screen sharing of physical devices. It allows you to plug in your device to your laptop and mirror the screen as well as allowing control of the device. A must have for working remotely.

Chucker

Chucker is an on-device network interceptor. It monitors network calls you make…


I’ve been working on getting Dark Mode in our app fully supported and I stumbled upon an interesting finding:

The Application#applicationContext does not keep information about the theme that you have set via AppCompatDelegate.setDefaultNightMode(), only a View or Activity context has this information stored.

After reading through Chris Banes’ articles and watching some great talks about Styles, Themes & Dark Mode, I felt pretty comfortable that I knew quite a bit about the Theming system on Android. However, this particular issue was something that I was not expecting, which is why I decided to document this particular problem I faced.

The Problem


Photo by Sven Brandsma on Unsplash

A quick dive into how we’ve used & over-used extension functions at Over

At Over, we’ve been using Kotlin since we started the new Android version of the app in November 2018. From day one, we’ve been excited to try the language features and leverage them to build our mobile design app.

One of the features we were most excited about was extension functions.

What is an Extension Function?

An extension function allows you to extend a classes functionality without needing to edit (or have access to) the class itself. They are great for libraries whose classes you can’t access.

This is an example of an extension function in Kotlin:

fun Canvas.center(): Point = Point(width / 2f, height…


I recently presented this talk at Kotlin Everywhere South Africa as the keynote for the event. I really enjoyed preparing this talk as it spoke about how we use Kotlin, mistakes we’ve made along the way and our opinion on how we decide to use certain features.

Talk Description:

Over the past year and a half, I’ve worked primarily on a Kotlin codebase. We at Over, were lucky enough to get a chance to start a project from scratch and we chose Kotlin for many reasons. …


Photo by Sharon McCutcheon on Unsplash

Diving into more Android Graphics Classes

Drawing on an Android Canvas is quite overwhelming, there are many different classes and concepts to understand when drawing something. If you haven’t already read part one of this series make sure to read it here.

In this post, we will be covering some classes that you will find available within the Android Framework which can make your life a bit easier when working with a canvas.

Rect / RectF ◼️

A rectangle class that stores four values: top, left, right and bottom. These can be used for drawing directly on canvas or just for storing sizes of objects that you want to draw.


Photo by Bench Accounting on Unsplash

Learn the basics of drawing with the Android Canvas Class

Diving into using the Android Canvas class can unlock magical super powers you never knew you had 🤯. Imagine being able to draw anything* your heart desires just with some basic shapes, paths and bitmaps? Well, the Android Canvas gives you just that ability.

What is a Canvas?

Canvas is a class in Android that performs 2D drawing of different objects onto the screen. The saying “a blank canvas” is very similar to what a Canvas object is on Android. It is basically, an empty space to draw onto.

The Canvas class is not a new concept, this class is actually wrapping a SKCanvas


Photo by rawpixel.com from Pexels

Learn how to use physics-based animations in a Custom View implementation for natural looking animations in your app.

You’ve used all the standard Android animation techniques, but you find that they sometimes just don’t give you that extra sparkle you are looking for. You’ve wondered how to get more natural looking animations and had no luck thinking about how to do it yourself. So here you are, reading this article in the hope that you will learn how to create beautiful, natural, physics-based animations in your app. 🌈

The Problem 🕵🏽‍♀️

The physics-based animation library is not new, but it was largely unexplored territory for me. Having always used the “standard” animation options (i.e. view.animate()), I had never found a need…


Learn how to use the Android KTX extension functions to clean up Canvas drawing code

Photo by Plush Design Studio on Unsplash

Have you ever wanted to write a Custom View on Android but you were too afraid to deal with X, Y translations on a Canvas object?

Well, working with them got a whole lot easier when using Kotlin and the Android KTX Extension functions provided by the Android Team at Google.

Drawing on Canvas without KTX 🙀🙅🏽‍♀️

If you want to translate (move) an object you are drawing on a Canvas, how would you go about doing that? You would likely need to do something like the following:

Canvas#save() and Canvas#restore() can be used to save() the current matrix (transformations like translate, rotate etc) and…


Learn how using ViewModels can help create great user experiences on ChromeOS

Image made with Over for Android(madewithover.com)

Supporting ChromeOS devices sounds like a large undertaking with many unknowns. If you didn’t know already, ChromeOS allows users to install Android Apps on their devices. This is great news for ChromeOS users since it unlocks a huge amount of apps that previously weren’t available to them.

Why should you build support for ChromeOS?

ChromeOS support seems like a big task that you may not think is important to implement. But if you do a bit of research into the Chromebook usage, you will see that there is a large portion of the US market that uses Chromebooks. ChromeOS made up 59.6% of mobile computing sales in…

Rebecca Franks

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store