March 2013
Beginner to intermediate
580 pages
16h 11m
English
Now that you have your styles set up, you can save some serious time. Let’s flesh out the remote control interface to a full, luxurious 12-key version, complete with ten deluxe decimal digits.
Now you need to create a 3 x 4 array of nearly identical buttons. But there’s no need to code them all individually. You can create one row of three buttons and then use it four times. Create a new file called res/layout/button_row.xml and move the row of buttons you have already defined into it.
Listing 24.7 A row of three buttons (layout/button_row.xml)
<?xml version="1.0" encoding="utf-8"?> <TableRow xmlns:android="http://schemas.android.com/apk/res/android" > <Button style="@style/RemoteButton" /> <Button style="@style/RemoteButton" ...
Read now
Unlock full access