Skip to content

Architecture and advanced usage

ZieIony edited this page May 19, 2015 · 1 revision

Carbon provides a good base of Lollipop's features like shadows or ripples. It doesn't offer the complete set of widgets though. The idea is to extend other libraries with Carbon features when neccessary.

For example, let's suppose that you need a floating action button. Carbon has one, but it's very simple. You found a nice library that gives you all kinds of FABs with labels, actions, animations, etc. The only downside is that the FAB library doesn't have real, animated shadows. Uses bitmaps or gradients. It would be nice to to merge Carbon with that library and get the best things of the two.

In this section I would like to teach you how to implement Carbon's features in your components so you can continue to use your favourite libraries while having shadows, ripples and all the stuff.

Interfaces

Carbon is built on top of standard Android widgets and patterns. This results in large amount of duplicated blocks of code, but makes the library fast, clean and easy to use. Most of the Carbon's features can be found in separate sections in code. Most of the features has a corresponding interface: