MediaChooser Android库 MediaChooser是一个库,浏览并选择视频和图像从SD卡。它可以用来显示文件中查看图像和视频(显示所有文件)或文件夹视图(显示文件分类)。项目按日期,时间与最新的产品呈现先排序。https://github.com/learnNcode/MediaChooser

Media Chooser

Library to browse & select videos and images from disk.

Screenshots

Setup

Add following permission to your applications manifest file.

 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Add following code to the application node of your application's manifest file

<activity
android:name="com.learnncode.mediachooser.activity.BucketHomeFragmentActivity"
android:screenOrientation="portrait" >
</activity> <activity
android:name="com.learnncode.mediachooser.activity.HomeFragmentActivity"
android:screenOrientation="portrait" >
</activity>

ChangeLog

Version 1.0.5

1] Updated picasso jar.

2] Preview file on item longpress.

3] Removed deprecated code.

Version 1.0.4

1] Fixed tab content issue.

Version 1.0.3

1] Fixed video icon visibility when video tab selected.

Version 1.0.2

1] Fixed blank image tab or video tab issue.

Version 1.0.1

1] Fixed nexus 10 crash.

2] Added helper methods for ease.

What does this library do ?

Useful library for selecting images and videos from sd-card. The library can be used to display images & videos in file view or folder view. File view shows all files whereas Folder view shows files categorized. All items are sorted according to date-time with latest item showing first.

Usage

To display images and videos according to:

1] Folders

Intent intent = new Intent(MainActivity.this, BucketHomeFragmentActivity.class);
startActivity(intent);

2] Files

Intent intent = new Intent(MainActivity.this, HomeFragmentActivity.class);
startActivity(intent);

To get list of selected images and videos :

1] For images you have to register a broadcast with

MediaChooser.IMAGE_SELECTED_ACTION_FROM_MEDIA_CHOOSERaction.

Example:

IntentFilter imageIntentFilter = new IntentFilter(MediaChooser.IMAGE_SELECTED_ACTION_FROM_MEDIA_CHOOSER);
registerReceiver(imageBroadcastReceiver, imageIntentFilter);

2] For videos you have to register a broadcast with MediaChooser.VIDEO_SELECTED_ACTION_FROM_MEDIA_CHOOSER action.

Example:

IntentFilter videoIntentFilter = new IntentFilter(MediaChooser.VIDEO_SELECTED_ACTION_FROM_MEDIA_CHOOSER);
registerReceiver(videoBroadcastReceiver, videoIntentFilter);

Helper methods

1] showCameraVideoView : To hide/show camera button. example:

MediaChooser.showCameraVideoView(false); // This will hide the view. By default its visible.

2] setImageSize and setVideoSize : To set file size limit in mb for image/video selection. example:

MediaChooser.setVideoSize(10); // Default set to 20mb.
MediaChooser.setImageSize(10); // Default set to 20mb.

3] setSelectionLimit : To set number of items that can be selected. example:

MediaChooser.setSelectionLimit(10);  //default set to 100.

4] setSelectedMediaCount / getSelectedMediaCount : To set/retrieve total selected file count. example:

int totalCount = MediaChooser.getSelectedMediaCount();

5] showOnlyImageTab :- To show image tab only. example:

MediaChooser.showOnlyImageTab();

6] showOnlyVideoTab :- To show video tab only. example:

MediaChooser.showOnlyVideoTab();

7] showImageVideoTab : To display both image and video tab. example:

MediaChooser.showImageVideoTab(); //By default both tabs are visible.

Check the attached demo sample app.

Acknowledgement

Picasso jar

License

Copyright 2013 learnNcode (learnncode@gmail.com)

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.

Thank You

If you like our work say a Hi :)

Happy Coding Happy Learning.

MediaChooser图库浏览器的更多相关文章

  1. iOS:选择器控件UIPickerView的详解和演示

    选择器控件UIPickerView: 功能:它能够创建一个类似于密码锁式的单列或多列的选择菜单,用户可以通过它设置的代理来选择需要菜单中的任意的数据.例如创建日历.字体表(类型.大小.颜色).图库等. ...

  2. leaflet开源地图库源码 浏览器&移动设备判断(browser.js)备份

    <script> var isIe = !-[1,]; // alert('ie9 之前'+isIe); var ie = 'ActiveXObject' in window; //ale ...

  3. 一站式解决,Android 拍照 图库的各种问题.

    在android开发中, 在一些编辑个人信息的时候,经常会有头像这么一个东西,就两个方面,调用系统相机拍照,调用系统图库获取图片.但是往往会遇到各种问题: 1.oom 2.图片方向不对 3.activ ...

  4. 微信内置浏览器WebApp开发,踩坑 · Issue #31 · maxzhang/maxzhang.github.com · GitHub

    最近花6天时间完成了一个七夕的小活动,是一个简单的WebApp.由于我前期对面向微信的Web开发评估不足,导致开发过程十分艰难.写这篇文章总结下,惊醒自己未来不要再犯这样的错误. 问题: 1. 有些比 ...

  5. 15款Chrome浏览器插件让设计师告别拖延症

    秋高气爽,分享一大波有效帮助设计师提高工作效率的Chrome浏览器扩展程序! 高效是另一种王道 无论是在工作中,还是在生活中,有些词我们说来就满满正能量,而另外一些话提起就很沮丧,后者如拖延症,前者如 ...

  6. 转:HTML5页面如何在手机端浏览器调用相机、相册功能

    HTML5页面如何在手机端浏览器调用相机.相册功能 开发微信端浏览器访问的HTML5的页面,页面中有一个<input id="input" type="file&q ...

  7. 【Android】内存卡图片读取器,图库app

    上一篇<[Android]读取sdcard卡上的全部图片而且显示,读取的过程有进度条显示>(点击打开链接)在真机上測试非常有问题.常常遇到内存溢出.卡死的情况.由于如今真机上的内存上,2G ...

  8. [python学习] 简单爬取图片站点图库中图片

    近期老师让学习Python与维基百科相关的知识,无聊之中用Python简单做了个爬取"游讯网图库"中的图片,由于每次点击下一张感觉很浪费时间又繁琐.主要分享的是怎样爬取HTML的知 ...

  9. 自己动手实现浏览器,21天自制chromium:起手篇

    转:https://zhuanlan.zhihu.com/p/29101613?utm_medium=social&utm_source=qq 大家好,我又来了.这篇是21天自制原子弹的姐妹篇 ...

随机推荐

  1. JS:函数多个参数默认值指定

    函数有一个参数时,以往这样定义(参数为p1): function mfun(p1){ … } 当需要为p1设定一个默认值时 function mfun(p1){ if(p1===undefined) ...

  2. GetModuleHandle,AfxGetInstanceHandle使用区别

    当一个文件被映射到调用进程的地址空间时,GetModuleHandle函数得到其中某一模块的句柄. 使用GetModuleHandle函数格式:HMODULE GetModuleHandle( LPC ...

  3. linux动态库加载RPATH, RUNPATH

    摘自http://gotowqj.iteye.com/blog/1926771 linux动态库加载RPATH, RUNPATH 链接动态库 如何程序在连接时使用了共享库,就必须在运行的时候能够找到共 ...

  4. 网易云课堂_C++程序设计入门(上)_第2单元:丹青画松石– EGE图形库

    第2节:一个简单的EGE程序 #ifndef _GRAPHICS_H_ #define _GRAPHICS_H_ #ifndef __cplusplus #error You must use C++ ...

  5. #include <amp.h>

    parallel_for_each(av.extent, [=](concurrency::index<1>idx)restrict(amp) {av[idx] += 1; }); //[ ...

  6. R基础

    R的对象类型包括数值型(numeric),复数型(complex),逻辑型(logical),字符型(character)和原味型(raw),列表(list)递归结构:函数(function)和表达式 ...

  7. 响应式布局之BootStrap

    本文在于巩固基础 学习bootStrap官网http://getbootstrap.com/ 响应式布局是Ethan Marcotte在2010年5月份提出的一个概念,简而言之,就是一个网站能够兼容多 ...

  8. 标准C++的string类使用

    原文:http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html 要想使用标准C++中string类,必须要包含#include & ...

  9. oracle权限的分配

    一.创建 sys:   //系统管理员,拥有最高权限 system://本地管理员,次高权限 scott: //普通用户,密码默认为tiger,默认未解锁 二.登陆 sqlplus / as sysd ...

  10. iOS开发之性能优化

    1.避免过于庞大的XIB 当加载XIB的时候把所有的东西都放在了内存里,包括任何的图片:如果有一个不会即刻用到的view,就会浪费宝贵的内存资源了. 当加载一个引用了图片或者声音资源的nib时,nib ...