Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

Matisse

> 开发工具
Open source

:fireworks: A well-designed local image and video selector for Android

12.5K stars0 likes2 views
WebsiteGitHub

About

:fireworks: A well-designed local image and video selector for Android

Matisse

Matisse is a well-designed local image and video selector for Android. You can

  • Use it in Activity or Fragment
  • Select images including JPEG, PNG, GIF and videos including MPEG, MP4
  • Apply different themes, including two built-in themes and custom themes
  • Different image loaders
  • Define custom filter rules
  • More to find out yourself
Zhihu Style Dracula Style Preview

Download

Gradle:

groovy
repositories {
    jcenter()
}

dependencies {
    implementation 'com.zhihu.android:matisse:$latest_version'
}

Check out Matisse releases to see more unstable versions.

ProGuard

If you use Glide as your image engine, add rules as Glide's README says.
And add extra rule:

pro
-dontwarn com.squareup.picasso.**

If you use Picasso as your image engine, add rules as Picasso's README says.
And add extra rule:

pro
-dontwarn com.bumptech.glide.**

Attention: The above progurad rules are correct.

How do I use Matisse?

Permission

The library requires two permissions:

  • android.permission.READ_EXTERNAL_STORAGE
  • android.permission.WRITE_EXTERNAL_STORAGE

So if you are targeting Android 6.0+, you need to handle runtime permission request before next step.

Simple usage snippet


Start MatisseActivity from current Activity or Fragment:

java
Matisse.from(MainActivity.this)
        .choose(MimeType.allOf())
        .countable(true)
        .maxSelectable(9)
        .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
        .gridExpectedSize(getResources().getDimensionPixelSize(R.dimen.grid_expected_size))
        .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
        .thumbnailScale(0.85f)
        .imageEngine(new GlideEngine())
        .showPreview(false) // Default is `true`
        .forResult(REQUEST_CODE_CHOOSE);

Themes

There are two built-in themes you can use to start MatisseActivity:

  • R.style.Matisse_Zhihu (light mode)
  • R.style.Matisse_Dracula (dark mode)

And Also you can define your own theme as you wish.

Receive Result

In onActivityResult() callback of the starting Activity or Fragment:

java
List<Uri> mSelected;

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQUEST_CODE_CHOOSE && resultCode == RESULT_OK) {
        mSelected = Matisse.obtainResult(data);
        Log.d("Matisse", "mSelected: " + mSelected);
    }
}

More

Find more details about Matisse in wiki.

Contributing

Matisse is an Open Source Project

Thanks

This library is inspired by Laevatein and uses some of its source code.

License

Copyright 2017 Zhihu Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Issues· 464 open

View all issuesOpen on GitHub
  • #899

    后续支持Live图的选择吗?包括iOS的以及安卓支持Live图拍摄的图片?

    Updated May 8, 2026
  • #852

    new bug

    Updated Jan 17, 2026
  • #812

    在打开相册后,左上角切换其他相册,全部都是一片空白,只有刚进来的时候 全部相册才有内容!!!这个问题也太大了吧

    Updated Oct 30, 2025
  • #900

    Updated Matisse: Forked Library with Android 15 Mandatory Insets Handling

    Updated Aug 4, 2025
  • #864

    切换到其他相册,一片空白,没有显示照片

    Updated Jul 17, 2025
  • #894

    I just updated the Library to Support Android 15

    Updated May 7, 2025
  • #898

    远程依赖出错的 目前可以先依赖这个 implementation 'com.github.baowenqing:Matisse:1.0.1'

    Updated Feb 22, 2025
  • #866

    请问还会继续更新维护吗?

    Updated Jan 20, 2025
  • #818

    图片预览角标越界

    Updated Jan 13, 2025
  • #896

    ...

    Updated Nov 29, 2024

> Tags

Javaandroidandroid-image-pickerandroid-image-selectorandroid-library

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具