Carbon Views not extending AppCompat views
ahmaducg opened this issue · 1 comments
Why are all the Carbon Views extending only the normal views? Like, TextView
instead of AppCompatTextView
? That makes it much harder to use these views with features like AutoResizeText
, drawableEnd
and more
Platform View classes are lighter and easier to extend. Carbon's goal was to provide correct, working implementations of Material ideas, and using plain View classes was a better option than dealing with existing, broken implementations in AppCompat. For example, AppCompat provides a method to set elevation on pre-Lollipop systems, but it doesn't do anything. I guess I could have kept both options by extending AppCompat classes, but at that point, that didn't seem necessary. I implemented only those features I needed for my project and I could implement them while keeping them working in exactly the same way on all supported API levels.
When it comes to your example, carbon.widget.TextView
has a built-in auto-sizing (which was there earlier than for AppCompat) and drawableEnd
is not 100% supported by AppCompat too since LTR layouts are missing on lower API levels. The differences in drawable*
attributes' support seem to be tinting selected drawables only (which I don't like) and support for vectors, which Carbon replaces with SVG support.
Last but not least, since Carbon is open source, you're free to clone it, change the base classes you need, and use it this way for your projects.