Picking files since 2015
Material file picker library for Android by Arte al Programar
Download library and add it to your project
or use JitPack.io
build.gradle (Project)
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
build.gradle (Module: app)
dependencies {
...
implementation 'com.github.arteaprogramar:Android_MaterialFilePicker:version'
}
colors.xml
...
#fafafa
...
styles.xml
...
@color/colorBackground
...
…Override on activity result:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == FILE_PICKER_REQUEST_CODE && resultCode == RESULT_OK) {
String filePath = data.getStringExtra(FilePickerActivity.RESULT_FILE_PATH);
// Do anything with file
}
}To create a compatible (Light/Dark) theme, you can change the following colors to suit your theme.
?colorPrimary
?colorPrimaryDark
?colorAccent
?android:colorBackground
#212121
#4000695C
#8a000000
Runtime permissions:
You should handle runtime permissions in activity, from what you called Material File Picker. Look here for example code.
No open issues yet, or sync has not completed.