Review

a lot of code changed
Instead of RelativeLayout you should use a more generic 'ViewGroup' or 'View' in case you ever decide to modify the parent layout in xml