-
Notifications
You must be signed in to change notification settings - Fork 14
Basic Usage
Abhishek Tiwari edited this page Jan 10, 2021
·
1 revision
UnicornFilePicker.from(MainActivity.this)
.addConfigBuilder()
.selectMultipleFiles(false)
.showOnlyDirectory(true)
.setRootDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
.showHiddenFiles(false)
.setFilters(new String[]{"pdf", "png", "jpg", "jpeg"})
.addItemDivider(true)
.theme(R.style.UnicornFilePicker_Dracula)
.build()
.forResult(Constants.REQ_UNICORN_FILE);
-
selectMultipleFiles(boolean)
-> enables/diables multiple file selection -
showOnlyDirectory(boolean)
-> when enabled, the file picker will disable only directories and allow selection for the same -
setRootDirectory(String)
-> specify custom root directory for the file picker -
showHiddenFiles(boolean)
-> choose if FilePicker displays hidden files in directory -
setFilters(String[])
-> filter out files you want the user to select -
addItemDivider(boolean)
-> shows/hides item divider for recycler view -
theme(@StyleRes int)
-> specify in-build theme or use a custom theme. Refer Theme -
build()
-> builds the configuration object -
forResult(requestCode)
-> starts the FilePicker Acitvity for result.