showOnlyDir not implemented ??
Closed this issue · 7 comments
Hi,
I appreciate your work : this chooser is fine and light, easy to implement !
But it seems that setShowOnlyDir(true) is not working (this parameter not recognized at compile time)
Is this functionality implemented ?
Hello @jplente ,
Thank you for the kind words.
Regarding your issue, the method setShowOnlyDir(bool)
works just fine. In fact, in the example project, the first implementation demonstrates just that. If you clone and run the example, you will find that the first option opens a file chooser specifically for directories.
For your further reading,
Thanks again and happy coding!
Hello @abhishekti7
Thanks for this prompt reply
FYI I work with Android Studio
My problem is that when i code as suggested this
button_import.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
UnicornFilePicker.from(Params_Database_Fragment.this)
.addConfigBuilder()
.selectMultipleFiles(false)
.setShowOnlyDir(true)
.setRootDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
.showHiddenFiles(false)
.setFilters(new String[]{"dbk","db"})
.addItemDivider(true)
.theme(R.style.UnicornFilePicker_Default)
.build()
.forResult(Constants.REQ_UNICORN_FILE);
List<String> mSelected_files;
}
Th line with setShowOnlyDir(true) is red written because not known by the compiler...
In my build.graddle (app) : implementation 'com.github.abhishekti7:UnicornFilePicker:1.0.1'
Is the UnicornFilePicker:1.0.1 including theOnlyDir option ?
Thanks in advance !
jplente
Hey,
Thank you so much for pointing this out. I must have been working on this and several features and added them in the documentation without releasing the next version.
The new version is out and so is the feature. Thanks.
Hello,
Thank you for your reply
however, I tryied with graddle instruction implementation 'com.github.abhishekti7:UnicornFilePicker:1.0.2'
After syncing, i got the same error : .setShowOnlyDir(true) not known by the compiler.
Hey,
I think the method that you are looking for is showOnlyDirectory()
instead of setShowOnlyDir(true)
.
Let me know if the issue is resolved.
Hello
It works, you were right ! I don't know why i wrote "setShowOnlyDir(true) " into my code, perhaps a wrong copy/paste... :(
Issue is resolved, thanks a lot for your active and prompt involvement !
JPL
It works with showOnlyDirectory() !
Thanks !