maandag 16 december 2013

Customizing Component Styles


At this point you might be done. Your app has a little bit custom theme and looks a bit different from apps that only use the default theme. But what if you are not happy with the button style want to change your component styles as well? Not to worry. There's a webapp for that too. The Android Holo Colors Generator will help you. It is a very simple tool that lets you define colors for your components. You pick the color you want and which components you want to replace and you're set. Of course, this is just a very small change to the default theme but if you want to change the component styles even more you can use the generated assets as the starting point and edit them in a tool of your choice.

Tip: to keep things separated give this style a different name than you gave to the action bar style.

In this example I've replaced the button as well as the edit text.













The same way as the other generators this webapp generates a ZIP file you need to download and extract into your app. It contains drawables as well as XML files.

Now you just need to enable the style in your app. This time we cannot do the same thing we did earlier with the action bar styles as that would override the action bar style. Instead, we can use make the new style the parent of the style we generated for the action bar. Look for the theme name defined in the new component style you created and change that to be the parent of the action bar style. As the component style has the Android Holo theme as its parent our app theme is still a Holo theme.



0 reacties:

Een reactie plaatsen