Code Monkey home page Code Monkey logo

mediaselect's Introduction

MediaSelect

#####a library for select and record photo,audio,video.


###简介

######一行代码完成 调用系统相册 和 视频,语音库,选择图片,视频,和音频文件。在选择界面实现了录制视频和录制音频功能。

###截图


###如何使用

  • 在build.gradle 中添加:

    compile 'com.huangyirui:mediaselect_library:1.0.0'

  • 在需要调用的地方:

            Constans.REQUEST_CODE);``` 
    
    
    *	第一个参数:传入Context
    *	第二个参数:传入的是选择类型 有三个类型  `MediaType.AUDIO_SELECT_TYPE` :音频类型 `MediaType.PHOTO_SELECT_TYPE` :图片类型 `MediaType.VIDEO_SELECT_TYPE` :视频类型
    *	第三个参数:传入显示最大的文件数
    *	第四个参数:返回的数据集  类型为:`List<Photo> mediaList `
    *	第五个参数:`onActivityResult`返回码 
    
    
    
  • 在返回的界面重写onActivityResult 方法


	 @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if (requestCode == Constans.REQUEST_CODE) {
            if (null != data) {
                mediaList =  data.getParcelableArrayListExtra(Constans.RESULT_LIST);

                mediaAdapter.setMediaList(mediaList);

                mediaAdapter.notifyDataSetChanged();
            }

        }
        super.onActivityResult(requestCode, resultCode, data);
    	}
	}

####Development by
Developer / Author: hyr0318 #####QQ:2045446584 #####Email:[email protected] #####Github:https://github.com/hyr0318/

Copyright 2016 HuangYiRui

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.
	

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.