Skip to content
ZieIony edited this page Mar 27, 2015 · 8 revisions
Why Android 2.1? Isn't 4.0 enough?

I have an old Galaxy S with Android 2.3, so I did that to support my own phone. It's also fun to push the limits. Android 2.1 should work, the code compiles, but I have never checked that.

Is it stable?

Seems like it's pretty stable. I'm testing it heavily on different devices and on real projects. There are minor problems with SVG rendering and shadow generation. Also the themes aren't perfect yet. These are the issues I know about. If you have something else, please let me know.

Are you using Lollipop's API on Lollipop devices?

No. Maybe one day.

Are you thinking about uploading the library to Maven?

Done!

Do you plan to offer your Material elements as separate modules? I would prefer not to include the whole project only to use ripples.

I thought about it, but it's not that easy, because almost everything is tightly integrated with other components. For example the ripple. Due to clipping issues in Android < 5.0 it's not possible to draw borderless backgrounds just by setting the background drawable. That's why I would have to export the ripple with all layouts only to make the borderless mode work.

If you wish, you can copy RippleDrawable.java to your project and integrate it with your code manually.

Can you add [put your feature name here]?

If it's possible and reasonable, sure! Just let me know.

The shadows aren't working. It says something about the RenderScript

You have to add these lines to your android build config:

renderscriptTargetApi 20
renderscriptSupportModeEnabled true

Carbon uses RenderScript for generating shadows. Gradle doesn't support renderscript very well, so it has to be done that way.

What is the debug mode? How to enable it?

Debug mode is a special rendering mode used for UI/UX debugging. Some of material components have touch areas larger than the actual components. It means that a user can tap outside a view and still trigger an action. Using debug mode you can preview all touch and draw areas in the editor. Red rectangles show hit areas, green rectanges - draw areas. Debug mode is also useful for SVG views debugging. SVG views appear empty, because SVG rendering is not supported in the editor.

RecyclerView and CardView

To enable the debug mode, add the following line to your theme:

<item name="carbon_debugMode">true</item>

Then go to the editor and pick that theme to be used by the editor. You can create two themes, with and without the debug info, so you can switch between them.

<style name="AppTheme" parent="carbon_Theme.Light">
    <!-- Customize your theme here. -->
</style>

<style name="AppTheme.Debug">
    <item name="carbon_debugMode">true</item>
</style>
Clone this wiki locally