Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Android UI Development

You're reading from  Hands-On Android UI Development

Product type Book
Published in Nov 2017
Publisher Packt
ISBN-13 9781788475051
Pages 348 pages
Edition 1st Edition
Languages
Author (1):
Jason Morris Jason Morris
Profile icon Jason Morris

Table of Contents (21) Chapters

Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
Creating Android Layouts Designing Form Screens Taking Actions Composing User Interfaces Binding Data to Widgets Storing and Retrieving Data Creating Overview Screens Designing Material Layouts Navigating Effectively Making Overviews Even Better Polishing Your Design Customizing Widgets and Layouts Activity Lifecycle
Test Your Knowledge Answers

Creating custom styles


When polishing your application, you'll find that certain styling requirements become common over the entire application, but in specific places. For example, the positive / go buttons should have a specific background color that highlights them from the other buttons in the application, or that the negative / delete buttons should have a color that highlights them as destructive for the user.

Android offers you the ability to define your own styles apart from those defined by the system. The theming system in Android is built entirely on top of the styling system. Styles have some very simple attributes:

  • Styles can be named
  • A style can change any attribute exposed in the layout XML file
  • A style can inherit from another style and override its attributes (a bit like classes extending each other)
  • Styles are defined as value resources (a bit like dimensions, strings, and colors)

Let's jump right in and create a new style for the travel claim application for the amount-input...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime}