mercredi 6 mai 2015

In Android, how can I make a form that changes depending on categories ? (the amount of inputs varies)

I'm doing a reminder application for Android that has an activity which is populated with inputs that depend on the category of the reminder. The amount of inputs (EditText) changes depending on the category, so im a little confused on how to tackle this case.

I propose 3 solutions here, but I'm not sure if there is a 4th solution or a better way to do it. I'm open to criticism. These are my choices:

  • I can make fragments for each category
  • Or I can make a common xml layout file that contains a number of inputs that reflect the category with most inputs, and find them programatically and assign them their properties
  • Or I can make the inputs programatically.

I'm trying to find the most elegant solution here. Thank you for your help.

Aucun commentaire:

Enregistrer un commentaire