All the Android top image cropper libraries.
The problem is more than well known: Every Android project that is using rxJava will at some time want to subscribe to data in one of the frameworks main classes like Activity or Fragment. Obviously, those classes are created and destroyed by the Android framework itself and therefore come with a given Lifecycle. Subscriptions to streams need to be disposed at the right time in order to avoid memory leaks.
Over the years the typical architecture of an Android application has changed a lot, from the first apps where all the logic was in the Activity a lot of different patterns have emerged. Right now MVP and MVVM are probably the most common architectural patterns for the UI (often together with something based on the clean architecture) but there are a lot of alternatives. For example, many developers are using something inspired by Redux, the state container usually used in React-based applications (web or mobile).
The next release of Kotlin, 1.3, is really near! Among the several features, I really enjoyed one that will allow library developers to write cleaner and better code: Kotlin contracts. In this blog post, we’ll see definitions, syntax, and examples for Kotlin contracts. But first, let’s start with a problem.