Custom Views as Components
Why?
How will you organize your android app’s 10k+ lines of code written by 10+ people? In a couple of months, before you know it, it’ll cross a 100k lines. Wouldn’t it be great if when a new feature requirement comes, you create a new class and start working on it, rather than worrying about what other things might break if you edit this 5k LoC Activity/Presenter class?
Create a new component!
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation.
- react js
A typical example:

The goal- isolation
In the example, each of the components (the background map, the chat head, the cards) have very little to no interaction with their sibling components or with the Activity. (The Activity is just a top-level component). This is the secret to writing clean code in UI heavy apps.
Each of the components has 0 to 3 public methods. Yes, some even have zero! (“how?” is a topic for another time). Just add your newly created component to your activity_layout.xml and you’re done. The component doesn’t care where it is placed, and its parent doesn’t care what the component is doing- the perfect relationship.
The lesser the number of public methods, the lesser the WTFs/minute.

In conclusion, use components with very few public methods to achieve a low WTFs/minute.
How?
Views are the best components.
Developers don’t realize that, rather than fragments, they can create custom views and use them as components. Views are light-weight and don’t blow up in your face with the infamous IllegalStateException.

The way I create components is that I create a new class that extends the FrameLayout. In it’s constructor, I inflate a layout.xml and add the inflated view as the only child of this FrameLayout.
Now your custom component class is ready to be added in another activity’s xml, in a recycler view, or even in another component!
So what are you waiting for? You can get started with components right away! No need to install new libraries or teach yourself (and your team) a new programming style.
I’d love to know if you are already using components or, even better, started using components after reading this. Let me know in the comments!