explaingit

zhihu/matisse

12,535JavaAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A drop-in Android library that adds a polished image and video picker screen to your mobile app, with customizable themes, selection limits, file filters, and support for Glide or Picasso image loading. Apache 2.0 licensed.

Mindmap

mindmap
  root((Matisse))
    What it does
      Android media picker
      Images and videos
    Customization
      Light and dark themes
      Custom filters
      Selection limits
    Integration
      Activity and Fragment
      Glide or Picasso
    Output
      List of file references
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add a ready-made photo and video picker to an Android app so users can select media from their phone gallery.

USE CASE 2

Apply custom filter rules to restrict which file types or sizes users can pick.

USE CASE 3

Apply a Dracula dark theme or a custom theme so the media picker matches the rest of the app.

Tech stack

JavaAndroidGlidePicasso

Getting it running

Difficulty · easy Time to first run · 30min

Requires an Android project with Glide or Picasso already configured as the image loader.

Use freely including in commercial apps, keep the copyright notice and license text.

In plain English

Matisse is an Android library that adds a polished media picker screen to mobile apps. When an app needs to let users choose images or videos stored on their phone, the developer would normally have to build that selector interface from scratch. Matisse provides a pre-built, well-styled version that can be dropped in with a few lines of code. The picker works inside both Activity and Fragment, the two primary building blocks of Android app screens. It supports selecting JPEG, PNG, and GIF image files alongside MPEG and MP4 video files. Developers can control how many items a user may select at once, adjust the size of thumbnail previews in the grid, lock screen orientation, and write custom filter rules to exclude certain file types or sizes from appearing in the picker at all. Two visual themes ship out of the box: a light style called Zhihu and a dark style called Dracula. Developers can also define their own custom themes so the picker blends with the rest of an app. The library also supports two image-loading tools commonly used in Android development, Glide and Picasso, and the developer picks which one to use with a small configuration call. Once a user makes their selections and confirms, the result comes back as a list of file references. The calling app can then use those references to upload files, display them, or process them however it needs. Matisse was built and open-sourced by Zhihu, a large Chinese question-and-answer platform. It carries an Apache 2.0 license.

Copy-paste prompts

Prompt 1
Show me how to integrate the Matisse Android media picker into an Activity and retrieve the list of selected image URIs.
Prompt 2
How do I set a maximum selection limit of 5 images and use Glide as the image loader in Matisse?
Prompt 3
Write a custom Matisse filter in Java that excludes GIF files from appearing in the picker.
Open on GitHub → Explain another repo

← zhihu on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.