MediaChooser图库浏览器
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
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图库浏览器的更多相关文章
- iOS:选择器控件UIPickerView的详解和演示
选择器控件UIPickerView: 功能:它能够创建一个类似于密码锁式的单列或多列的选择菜单,用户可以通过它设置的代理来选择需要菜单中的任意的数据.例如创建日历.字体表(类型.大小.颜色).图库等. ...
- leaflet开源地图库源码 浏览器&移动设备判断(browser.js)备份
<script> var isIe = !-[1,]; // alert('ie9 之前'+isIe); var ie = 'ActiveXObject' in window; //ale ...
- 一站式解决,Android 拍照 图库的各种问题.
在android开发中, 在一些编辑个人信息的时候,经常会有头像这么一个东西,就两个方面,调用系统相机拍照,调用系统图库获取图片.但是往往会遇到各种问题: 1.oom 2.图片方向不对 3.activ ...
- 微信内置浏览器WebApp开发,踩坑 · Issue #31 · maxzhang/maxzhang.github.com · GitHub
最近花6天时间完成了一个七夕的小活动,是一个简单的WebApp.由于我前期对面向微信的Web开发评估不足,导致开发过程十分艰难.写这篇文章总结下,惊醒自己未来不要再犯这样的错误. 问题: 1. 有些比 ...
- 15款Chrome浏览器插件让设计师告别拖延症
秋高气爽,分享一大波有效帮助设计师提高工作效率的Chrome浏览器扩展程序! 高效是另一种王道 无论是在工作中,还是在生活中,有些词我们说来就满满正能量,而另外一些话提起就很沮丧,后者如拖延症,前者如 ...
- 转:HTML5页面如何在手机端浏览器调用相机、相册功能
HTML5页面如何在手机端浏览器调用相机.相册功能 开发微信端浏览器访问的HTML5的页面,页面中有一个<input id="input" type="file&q ...
- 【Android】内存卡图片读取器,图库app
上一篇<[Android]读取sdcard卡上的全部图片而且显示,读取的过程有进度条显示>(点击打开链接)在真机上測试非常有问题.常常遇到内存溢出.卡死的情况.由于如今真机上的内存上,2G ...
- [python学习] 简单爬取图片站点图库中图片
近期老师让学习Python与维基百科相关的知识,无聊之中用Python简单做了个爬取"游讯网图库"中的图片,由于每次点击下一张感觉很浪费时间又繁琐.主要分享的是怎样爬取HTML的知 ...
- 自己动手实现浏览器,21天自制chromium:起手篇
转:https://zhuanlan.zhihu.com/p/29101613?utm_medium=social&utm_source=qq 大家好,我又来了.这篇是21天自制原子弹的姐妹篇 ...
随机推荐
- C语言的本质(30)——C语言与汇编之ELF文件格式
ELF(Executable and Linking Format)文件格式是一个开放标准,各种UNIX系统的可执行文件都采用ELF格式,ELF是一种对象文件的格式,用于定义不同类型的对象文件(Obj ...
- html类,id规范命名
DIV+CSS的命名规则 SEO(搜索引擎优化)有很多工作要做,其中对代码的优化是一个很关键的步骤.为了更加符合SEO的规范,下面中部IT网将对目前流行的CSS+DIV的命名规则整理如下: 页头:he ...
- Linux 零碎知识点
ln -s ../libs/ libs 在当前目录下建立一个符号链接文件libs,使它指向上一层目录的libs文件夹 关于su和su -的区别切换用户是可以使用su tom或者su - tom来实现, ...
- 呵呵!手把手带你在 IIS 上执行 Python
公司的站点让我头痛死了.在众多前辈高手的带领下.一大堆的 CMD 在站点里执行得好好地,黑客攻击也好好地.仅仅有站点和我不好好地,我快累死了,站点快挂了.. . 为了解决问题.我想到了 Python ...
- 关于smali插桩
虽说是老生常谈的东西了,稍微记录一下. 我觉得最重要的就是寄存器的问题了,如果需要额外的寄存器,要在smali函数的最前面将寄存器数量增加到需要的数量. 在smali代码中,寄存器有两种表示方式,一种 ...
- jQuery.innerWidth() 函数详解
innerWidth()函数用于设置或返回当前匹配元素的内宽度. 内宽度包括元素的内边距(padding),但不包括外边距(margin).边框(border)等部分的高度.如下图: 如果你要获取 ...
- MySQL导入sql 文件的5大步骤
http://database.51cto.com/art/201005/200739.htm 以下的文章主要介绍的是MySQL导入sql 文件,即MySQL数据库导入导出sql 文件的实际操作步骤, ...
- Hadoop 安装 (4) SSH无密码验证配置
验证SSH 和 RSYNC 已经安装好了 Master 生成密码对以及对于 Slave 的无密码登录. 见:http://www.cnblogs.com/xia520pi/archive/2012/0 ...
- 清除float常用方法(:after和clear:both)
参考网址:http://jingyan.baidu.com/article/c74d60006bea410f6a595d17.html .clearfix:after{ .....} 和 .clea ...
- javascript 里找元素操作元素
javascript 一.找到元素. var d = document.getElementById("") var d = document.getElementsByNa ...