DHASA2017 / MediaPicker

高仿微信选择图片和视频的控件。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MediaPicker

介绍

高仿Android版微信的图片和视频选择器。

集成库

Step 1. Add the JitPack repository to your build file

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

	dependencies {
	        compile 'com.github.xushihai:MediaPicker:v1.1'
	}

使用教程

 GalleryFinal.selectMedias(this, 10, new GalleryFinal.OnSelectMediaListener() {
            @Override
            public void onSelected(ArrayList<Photo> photoArrayList) {
                
            }
        });
  GalleryFinal.selectMedias(this, GalleryFinal.TYPE_IMAGE,10, new GalleryFinal.OnSelectMediaListener() {
            @Override
            public void onSelected(ArrayList<Photo> photoArrayList) {
 
            }
        });
    使用EventBus3.0注册,接收选择好的图片和视频列表
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void sendMedia(ArrayList<Photo> photoList) {
        Log.e("多媒体", photoList.toString());
    }
    
    GalleryFinal.selectMedias(this, 10);

使用了v7兼容包,EventBus,Glide,RecyclerView组件。如果项目中包含了这些组件可以使用exclude将这几个组件排除。

 exclude group: 'com.android.support', module: 'appcompat-v7'
 exclude group: 'com.android.support', module: 'recyclerview-v7'
 exclude group: 'org.greenrobot', module: 'eventbus'
 exclude group: 'com.github.bumptech.glide', module: 'glide'

截图

[N|Solid] [N|Solid] [N|Solid] [N|Solid]

About

高仿微信选择图片和视频的控件。


Languages

Language:Java 100.0%