{"id":13644730,"url":"https://github.com/nbsp-team/MaterialFilePicker","last_synced_at":"2025-04-21T10:34:14.438Z","repository":{"id":52583495,"uuid":"44779535","full_name":"nbsp-team/MaterialFilePicker","owner":"nbsp-team","description":"Picking files since 2015","archived":false,"fork":false,"pushed_at":"2023-02-05T02:12:13.000Z","size":788,"stargazers_count":1169,"open_issues_count":35,"forks_count":232,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-04-16T01:09:48.919Z","etag":null,"topics":["android","android-library","file-picker","material","picker"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbsp-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-10-22T23:39:18.000Z","updated_at":"2025-04-15T09:06:33.000Z","dependencies_parsed_at":"2022-08-13T02:01:11.410Z","dependency_job_id":"8ac72b25-019a-4456-bd23-039949f1ca65","html_url":"https://github.com/nbsp-team/MaterialFilePicker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbsp-team%2FMaterialFilePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbsp-team%2FMaterialFilePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbsp-team%2FMaterialFilePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbsp-team%2FMaterialFilePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbsp-team","download_url":"https://codeload.github.com/nbsp-team/MaterialFilePicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040718,"owners_count":21365153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","file-picker","material","picker"],"created_at":"2024-08-02T01:02:11.609Z","updated_at":"2025-04-21T10:34:09.428Z","avatar_url":"https://github.com/nbsp-team.png","language":"Java","readme":"# Material File Picker Unofficial\nMaterial file picker library for Android by Arte al Programar\n\n![](ss/main.png)\n\n## What's new\n- Require Android Jelly Bean 4.1.x (API 16+)\n- Android 10 Compatibility\n- Material Components for Android Support\n- Night Mode Support\n- New Icon Designs \n\n\n## Add your project\n\nDownload library and add it to your project\n\nor use `JitPack.io`\n\n```\nbuild.gradle (Project)\n\nallprojects {\n    repositories {\n        jcenter()\n        maven { url \"https://jitpack.io\" }\n    }\n}\n\n\nbuild.gradle (Module: app)\n\ndependencies {\n    ...\n    implementation 'com.github.arteaprogramar:Android_MaterialFilePicker:version'\n}\n\n\n```\n\n## Using (IMPORTANT)\n\n- Add to Values\n\n```\ncolors.xml\n\u003cresources\u003e\n    ...\n    \u003ccolor name=\"colorBackground\"\u003e#fafafa\u003c/color\u003e\n    ...\n\u003c/resources\u003e\n\nstyles.xml\n\n\u003cresources\u003e\n\n    ...\n    \u003citem name=\"android:colorBackground\"\u003e@color/colorBackground\u003c/item\u003e\n    ...\n\u003c/resources\u003e\n\n```\n\n- Open your class and add the following code\n\n```\n...\npublic static final int FILE_PICKER_REQUEST_CODE = 989\n...\n\nMaterialFilePicker()\n    // Pass a source of context. Can be:\n    //    .withActivity(Activity activity)\n    //    .withFragment(Fragment fragment)\n    //    .withSupportFragment(androidx.fragment.app.Fragment fragment)\n    .withActivity(this)\n    // With cross icon on the right side of toolbar for closing picker straight away\n    .withCloseMenu(true)\n    // Entry point path (user will start from it)\n    .withPath(alarmsFolder.absolutePath)\n    // Root path (user won't be able to come higher than it)\n    .withRootPath(externalStorage.absolutePath)\n    // Showing hidden files\n    .withHiddenFiles(true)\n    // Want to choose only jpg images\n    .withFilter(Pattern.compile(\".*\\\\.(jpg|jpeg)$\"))\n    // Don't apply filter to directories names\n    .withFilterDirectories(false)\n    .withTitle(\"Sample title\")\n    .withRequestCode(FILE_PICKER_REQUEST_CODE)\n    .start()\n...\n\n```\n\nOverride on activity result:\n\n```java\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n    super.onActivityResult(requestCode, resultCode, data);\n\n    if (requestCode == FILE_PICKER_REQUEST_CODE \u0026\u0026 resultCode == RESULT_OK) {\n        String filePath = data.getStringExtra(FilePickerActivity.RESULT_FILE_PATH);\n        // Do anything with file\n    }\n}\n```\n\n## Themes\n\nTo create a compatible (Light/Dark) theme, you can change the following colors to suit your theme.\n\n```\n    \u003c!-- App Colors --\u003e\n    \u003ccolor name=\"colorPrimary\"\u003e?colorPrimary\u003c/color\u003e\n    \u003ccolor name=\"colorPrimaryDark\"\u003e?colorPrimaryDark\u003c/color\u003e\n    \u003ccolor name=\"colorAccent\"\u003e?colorAccent\u003c/color\u003e\n    \u003ccolor name=\"colorBackground\"\u003e?android:colorBackground\u003c/color\u003e\n\n    \u003c!-- Default Colors --\u003e\n    \u003ccolor name=\"textColorPrimary\"\u003e#212121\u003c/color\u003e\n    \u003ccolor name=\"colorControlHighlight\"\u003e#4000695C\u003c/color\u003e\n\n    \u003c!-- (API 21 Status Bar Color) (API 23 Navigation Bar Color)--\u003e\n    \u003ccolor name=\"colorPrimaryDarkVariant\"\u003e#8a000000\u003c/color\u003e\n\n```\n\nRuntime permissions:\n\nYou should handle runtime permissions in activity, from what you called Material File Picker.\nLook [here](https://github.com/nbsp-team/MaterialFilePicker/blob/master/app/src/main/java/com/dimorinny/sample/MainActivity.java#L38-L69) for example code.\n\n","funding_links":[],"categories":["文件操作"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbsp-team%2FMaterialFilePicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbsp-team%2FMaterialFilePicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbsp-team%2FMaterialFilePicker/lists"}