Bearded-Hen / Android-Bootstrap

Bootstrap style widgets for Android, with Glyph Icons
MIT License
7.29k stars 1.43k forks source link

Add BootstrapLayout #151

Open StNekroman opened 8 years ago

StNekroman commented 8 years ago

There is BootstrapButton view, which (as I understood) acts like an TextView and supports text and FontAwesome icons inside. But it doesn't support custom view inside. Use-case: I want to put color-selector anchor to the right side of the button. So I suggest to create so-called "BootstrapLayout" which will act like and ViewGroup and provide basic functionality:

In other words, the same as BootstrapButton does, but without text="..." attribute. Then BootstrapButton can be inherited from BootstrapLayout, via defining TextView or AwesomeTextView inside. Main idea - that I need clickable custom view with standard borders + rounded + disable flag for my custom content.

StNekroman commented 8 years ago

BTW, there is iconics library from Mike Penz, which do like to user as inner content of button. It supports material icons and a lot of other icon libs instead of font awesome.

jamie-beardedhen commented 8 years ago

I think it makes more sense to put the BootstrapButton into a custom ViewGroup than to make it extend one. The BootstrapButtonGroup has some limited support for grouping buttons (but doesn't support any other views, and has quite a limited API that doesn't let you change colors individually).

It might even make sense to implement the whole Bootstrap grid system as a ViewGroup if we're going down this route. But I suspect that would take quite a bit of work.

Also this library supports custom fonts - at the minute only Typicon and FontAwesome are included by default, but it's possible to add your own.

StNekroman commented 7 years ago

I need ViewGroup with rounded corners in bootstrap-style colors. Currently I can achieve this only using my own custom view. But that would be nice to have BootstrapViewGroup in this library which will support custom content (just a ViewGroup). Becuase I cannot inject custom view into BootstrapButton, because button is not a ViewGroup.