Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styles and Theme #29

Closed
theDazzler opened this issue Dec 12, 2013 · 0 comments
Closed

Styles and Theme #29

theDazzler opened this issue Dec 12, 2013 · 0 comments

Comments

@theDazzler
Copy link
Contributor

This feature probably needs the most discussion and it really is for the benefit of the developer rather than the user. I added styles for BootstrapButton and BootstrapEditText.
Advantages:

  1. You can specify defaults without going into the class code. For example,
    <style name="BootstrapButton" parent="android:style/Widget.Button"> <item name="android:padding">8dp</item> <item name="android:textSize">14sp</item> <item name="bb_roundedCorners">true</item> </style>

gives each BootstrapButton 8dp padding, 14sp font, and round corners by default. The user can override all these by just doing what he would normally do in the layout xml file. As you can see, custom attributes can be placed in here as well i.e "bb_roundedCorners". It is much easier for the developer to just change settings here than it is to go into the java code and change stuff.

It isn't a huge deal though because there aren't too many defaults to set for BootstrapButtons. But it may make it easier if more widgets get added.

Disadvantage:

  1. The user has to add this to his styles.xml file. He goes to where his theme is located and adds this:
    <item name="bootstrapButtonStyle">@style/BootstrapButton</item> <item name="bootstrapEditTextStyle">@style/BootstrapEditText</item>

So it would end up looking like this after the above 2 lines are added:
<style name="AppTheme" parent="AppBaseTheme"> <item name="bootstrapButtonStyle">@style/BootstrapButton</item> <item name="bootstrapEditTextStyle">@style/BootstrapEditText</item> </style>

I think it's a fair tradeoff, but if more widgets are added to Android Bootstrap with styles, you need to add each one like above. But in the end, it just ends up being a copy and paste by the user, so it will take less than 10 seconds.

I also removed the need for the user to have to download the FontAwesome font and put it into their project. So it evens out kind of. I am 50/50 on this feature. I think it's awesome for developers because it is easier to make changes. But without it, it is nice being able to remove 2 steps for the user in order to use the library (not having to putting font in project and not having to add the styles)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant