Are your views polluted with TextWatchers that only implement one of the
three methods? Solution: Adapterize!
This isn’t a big problem; more of an annoyance. You’ll often see this in your
See what’s going on? We have to implement the two other methods yet we don’t
need them at all. Let’s write a small adapter class to tackle this.
Adapter class for your TextWatchers
A simple solution for this is to write an adapter class that implements
As you see, we now have an abstract class that implements the interface. To
put this to use, let’s change our original code to use this:
There we go! We can implement just the methods we need. Often times you’ll just
need one of them, and this will definitely help you out to keep your views a tad