what would be a good approach for the following?
EditText
EditText
EditText
the above three edit texts are how I have my xml layout. Depending on the users settings up on the server.. these edittexts need to be changed to a dropdown.
so for dropdowns if field1 is false field2 is true and field3 is false it would look like
EditText
DropDown
EditText
Should I
- do it all programatically at runtime,
removing existing views from xml and putting an empty ViewGroup in its place - have both options for each field in xml, and only show valid one (seems inefficient)
- some other approach I havent thought of
I might use ViewStubs. The view isn’t inflated until you do it. You would have 6 ViewStubs but only 3 would get inflated at RunTime.