{"id":19808734,"url":"https://github.com/zhihu/matisse","last_synced_at":"2025-05-12T15:16:20.484Z","repository":{"id":37733290,"uuid":"88111990","full_name":"zhihu/Matisse","owner":"zhihu","description":":fireworks: A well-designed local image and video selector for Android","archived":false,"fork":false,"pushed_at":"2023-05-15T09:55:57.000Z","size":1991,"stargazers_count":12553,"open_issues_count":466,"forks_count":2063,"subscribers_count":239,"default_branch":"master","last_synced_at":"2025-04-09T19:04:35.441Z","etag":null,"topics":["android","android-image-picker","android-image-selector","android-library","video-selector"],"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/zhihu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-13T01:31:05.000Z","updated_at":"2025-04-09T14:13:44.000Z","dependencies_parsed_at":"2022-07-18T01:30:47.134Z","dependency_job_id":"38c1998a-23d2-4db2-b52c-caddeaa6a634","html_url":"https://github.com/zhihu/Matisse","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhihu%2FMatisse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhihu%2FMatisse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhihu%2FMatisse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhihu%2FMatisse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhihu","download_url":"https://codeload.github.com/zhihu/Matisse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477812,"owners_count":21437049,"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-image-picker","android-image-selector","android-library","video-selector"],"created_at":"2024-11-12T09:14:40.001Z","updated_at":"2025-04-23T17:10:46.544Z","avatar_url":"https://github.com/zhihu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Image](/image/banner.png)\n\n# Matisse\n[![Build Status](https://travis-ci.org/zhihu/Matisse.svg)](https://travis-ci.org/zhihu/Matisse) [ ![Download](https://api.bintray.com/packages/zhihu/maven/matisse/images/download.svg) ](https://bintray.com/zhihu/maven/matisse/_latestVersion)\n\nMatisse is a well-designed local image and video selector for Android. You can  \n- Use it in Activity or Fragment\n- Select images including JPEG, PNG, GIF and videos including MPEG, MP4 \n- Apply different themes, including two built-in themes and custom themes\n- Different image loaders\n- Define custom filter rules\n- More to find out yourself\n\n| Zhihu Style                    | Dracula Style                     | Preview                          |\n|:------------------------------:|:---------------------------------:|:--------------------------------:|\n|![](image/screenshot_zhihu.png) | ![](image/screenshot_dracula.png) | ![](image/screenshot_preview.png)|\n\n## Download\nGradle:\n\n```groovy\nrepositories {\n    jcenter()\n}\n\ndependencies {\n    implementation 'com.zhihu.android:matisse:$latest_version'\n}\n```\n\nCheck out [Matisse releases](https://github.com/zhihu/Matisse/releases) to see more unstable versions.\n\n## ProGuard\nIf you use [Glide](https://github.com/bumptech/glide) as your image engine, add rules as Glide's README says.  \nAnd add extra rule:\n```pro\n-dontwarn com.squareup.picasso.**\n```\n\nIf you use [Picasso](https://github.com/square/picasso) as your image engine, add rules as Picasso's README says.  \nAnd add extra rule:\n```pro\n-dontwarn com.bumptech.glide.**\n```\n**Attention**: The above progurad rules are correct.\n\n## How do I use Matisse?\n#### Permission\nThe library requires two permissions:\n- `android.permission.READ_EXTERNAL_STORAGE`\n- `android.permission.WRITE_EXTERNAL_STORAGE`\n\nSo if you are targeting Android 6.0+, you need to handle runtime permission request before next step.\n\n#### Simple usage snippet\n------\nStart `MatisseActivity` from current `Activity` or `Fragment`:\n\n```java\nMatisse.from(MainActivity.this)\n        .choose(MimeType.allOf())\n        .countable(true)\n        .maxSelectable(9)\n        .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))\n        .gridExpectedSize(getResources().getDimensionPixelSize(R.dimen.grid_expected_size))\n        .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)\n        .thumbnailScale(0.85f)\n        .imageEngine(new GlideEngine())\n        .showPreview(false) // Default is `true`\n        .forResult(REQUEST_CODE_CHOOSE);\n```\n \n#### Themes\nThere are two built-in themes you can use to start `MatisseActivity`:\n- `R.style.Matisse_Zhihu` (light mode)\n- `R.style.Matisse_Dracula` (dark mode)  \n\nAnd Also you can define your own theme as you wish.\n\n#### Receive Result\nIn `onActivityResult()` callback of the starting `Activity` or `Fragment`:\n\n```java\nList\u003cUri\u003e mSelected;\n\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n    super.onActivityResult(requestCode, resultCode, data);\n    if (requestCode == REQUEST_CODE_CHOOSE \u0026\u0026 resultCode == RESULT_OK) {\n        mSelected = Matisse.obtainResult(data);\n        Log.d(\"Matisse\", \"mSelected: \" + mSelected);\n    }\n}\n```\n\n#### More\nFind more details about Matisse in [wiki](https://github.com/zhihu/Matisse/wiki).\n\n## Contributing\n[Matisse is an Open Source Project](https://github.com/zhihu/Matisse/blob/master/CONTRIBUTING.md)\n\n## Thanks\nThis library is inspired by [Laevatein](https://github.com/nohana/Laevatein) and uses some of its source code.\n\n## License\n\n    Copyright 2017 Zhihu Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhihu%2Fmatisse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhihu%2Fmatisse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhihu%2Fmatisse/lists"}