I have an Android view that includes a RadioGroup with three RadioButtons. When one of the RadioButtons is selected, the user also has to enter text into an EditText control. If either of the other two RadioButtons are selected, this extra information is not required.
I’m currently using the OnCheckedChangedListener for the RadioGroup to determine when a new RadioButton is checked, and hiding the EditText by setting its visibility to View.GONE. However this is a little jarring, and I’m wondering if there is a way that I could animate the transition at all. Is this possible, and if so, whats the key to getting started?
I’ve come up with the following workable solution, which was based on code I found at http://tech.chitgoks.com/2011/10/29/android-animation-to-expand-collapse-view-its-children/
In my activity:
Implementation from EDNUtils: