June 2013
Intermediate to advanced
216 pages
6h 3m
English
In this chapter, you’ll read about different hacks that use views. Most of them show how to customize and/or tweak widgets to perform certain functionalities.
We all know that validating data in forms is boring as well as error-prone. I worked on an Android application that used a lot of forms and had a couple of date inputs. I didn’t want to validate the date fields, so I found an elegant way to avoid it. The idea is to make users think they have an EditText when it’s in fact a button that will show a DatePicker when clicked.
To make this happen, we’ll change the default background of an Android Button to the EditText’s background. ...