Simple and customizable directory selector component for Android.
Screenshot on Android 4.4 using the default styles:
Integrating the component to your existing project is very simple. Probably the easiest approach is (using Eclipse):
- Clone and import the project into your workspace
- Reference the project as a library from your application
- Check out the example below how to take it into use
For more information on using Android library projects, see:
http://developer.android.com/tools/projects/projects-eclipse.html
DirectorySelectorDialog dialog = new DirectorySelectorDialog.Builder(this)
.directory(selectedDirectory)
.sortBy(DirectorySelectorDialog.SORT_NAME)
.orderBy(DirectorySelectorDialog.ORDER_ASCENDING)
.build();
dialog.addDirectorySelectorListener(new DirectorySelectorListener() {
@Override
public void onDirectorySelected(File directory) {
// ...
}
});
dialog.show();