Bearded-Hen / Android-Bootstrap

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

Making bootstrap button extend android.widget.button #211

Open greatjack1 opened 6 years ago

greatjack1 commented 6 years ago

I started using this library to spruce up my app, and I noticed that while most controls just required me to change the xml layout files, the bootstrap button required me to change my controller code since bootstrap button does not extend from android.widget.button. What was the reason for this design decision? and if possible can it be changed?

fractalwrench commented 6 years ago

It extends AwesomeTextView, which in turns extends TextView. This was done as a lot of behaviour such as Bootstrap themes, and Font icons, is common across multiple classes (e.g. BootstrapButton, BootstrapLabel).

BootstrapButton also makes use of some custom touch event logic, which IMO could feel quite confusing to users if the class was extending a regular Android button - as you'd expect it to have the regular Android touch behaviour.

If there are good reasons to change the design of the class then I'm happy to change the implementation