Photo by Tobias Carlsson on Unsplash

There is a lot of articles about coroutines and Firebase firestore, but I found none about the real-time database. I am aware that RTD evolved into a more mature version — firestore, but there is a lot of projects still running on RTD. This article is just for them.

The difference

The key difference between these two databases, in my opinion, is in querying the data. Both databases offer to sort and filter the data, but RTD can eighter sort or filter in a single query, never both. The Firestore, on the other hand, supports indexed queries with compound sorting and filtering…

The keyboard management is one of the biggest problems of the Android platform since API 1. That was almost 12 years ago. However, there are mentions of a very promising API on the horizon. In Android 11, most probably, we will finally get the control of the Soft Input Keyboard. The SDK level 30 is right now in a beta stage (July 2020) and there is currently no evidence that these functions will work on older SDKs. …

Photo by Jordan Madrid on Unsplash

Good in-app navigation is essential for the user experience. As is the flexibility that allows you to program to the new requirements. By introducing Navigation Component in Android Jetpack, Google showed a straight way to maintain the flow of our app from a central location.

In this article, I will show you how to use nested fragments in Navigation with additional help from Koin to provide the same instance of ViewModel across different destinations.

The setup

We are going to follow the single activity navigation pattern recommended by Google (link). …

Motion Layout is a powerful tool that helps you manage motion and animation in your app. To learn more about it, hit to the official docs and/or check the series of articles by Nicolas Roard. In this article I will focus on how to set nice swipe animation in RecyclerView item.

TL;DR —below is the result. The code can be found on github, scene 13.

Handling view changes when keyboard opens in Android is a painful game - everyone that tried that knows what I am talking about. Animating views on keyboard opens in fragment is even worst. I came up with a solution to this problem, but it is still far from perfect. In this article I will try to show you what ugly tricks needed to be done to create a slick animation when softInputKeyboard opens.

Defining problem

In GoodOnes (Swedish/Norwegian dating app by Mötesplatsen), we always aim for having a cool design, which also includes animations. One of the requirements from our designer was…

I do not know any app that is not using some sort of database to store user data. Either its some online service or local storage, but there is always something. However in some cases we do not need to store dozens of entries, just few simple values. That is the moment to use Shared Preferences.

Why multiple Shared Preferences?

There are several reasons why would you like to have multiple instances or repositories with shared preferences, I will try to list few:

  • increased readability, different instances of sharedPreferences can store data needed for different processes, views or user action
  • security, some data should…

Bruce copies

Did you ever copied the whole view just to change the image or text which it contains? Maybe you had more demanding task like copying the view but change its functionality/logic? This article will show you how to omit the copying and creating a lot of boilerplate.

TL;DR: Use Kotlin High Order Functions and Parcelize to pass needed values between views, code sample

Prepare the view layout

Assume, we have a view with title, main text, image and two buttons. Example:

Piotr Prus

Android Developer @Schibsted Enthusiast of kotlin and clean architecture.

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