Challenge: Style Inheritance

Your Delete and Enter buttons are sitting modestly at the bottom of the screen with the same style as all the number buttons. These action buttons need a bolder style.

For this small challenge, make those buttons look special. Create a new button style that inherits from your RemoteButton style and sets a bold text style attribute. Then make your bottom row use your new style for the first and third buttons.

Creating a style that inherits from another is simple. There are two ways to do it. One is to set the parent attribute of your style to the name of the style you want to inherit from. The easier way is to just prefix your style name with your parent’s style, then a dot – e.g., ParentStyleName.MyStyleName

Get Android Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.