android - Change layout dynamically in DialogFragment -
i want use dialog allow user scan device files extension , import of them.
to that, plan show dialog, have following behaviour:
- while scan sd card, dialog show progress bar , 1 textview path of last file found.
- after scanning sd card, show list in same dialog files found. user select of them (with checkboxes) , click on "import" or "cancel".
i'm wondering what's best strategy implement this?
i can think of 2 possibilites:
- use 2 fragments (one each 1 of steps explained above), , switch fragment when scan finishes. far couldn'αΊ— find how switch fragment inside dialog.
- use 1 fragment , change layout dinamically. means having single layout both functionalities, , show or hide them alternatively (with
view.visible
,view.gone
). prefer other option because here inflate view won't shown.
display listview dialogfragment , use emtptyview progress. implement loader scan files. when loader finished work use adapter listview , empty view disapear automaticly.
Comments
Post a Comment