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_CHOOSER
action.
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天自制原子弹的姐妹篇 ...
随机推荐
- bzoj2014 [Usaco2010 Feb]Chocolate Buying
Description 贝西和其他奶牛们都喜欢巧克力,所以约翰准备买一些送给她们.奶牛巧克力专卖店里 有N种巧克力,每种巧克力的数量都是无限多的.每头奶牛只喜欢一种巧克力,调查显示, 有Ci头 ...
- 关于k-means聚类算法的matlab实现
在数据挖掘中聚类和分类的原理被广泛的应用. 聚类即无监督的学习. 分类即有监督的学习. 通俗一点的讲就是:聚类之前是未知样本的分类.而是根据样本本身的相似性进行划分为相似的类簇.而分类 是已知样本分类 ...
- AJAX提交到Handler.ashx一般处理程序返回json数据 (字符串拼接方式)
<%@ WebHandler Language="C#" Class="Handler" %> using System; using System ...
- php学习网址
后面会陆续维护此页. 1. php编程 此博客是网站www.beilei123.cn镜像,转载请注明出处.
- Ajax制作无刷新评论系统
index.html <script src="jquery.min.js"></script> <script> $(function(){ ...
- linux命令学习03-grep
实例1.查找某个进程 #ps -ef | grep ssh root 1771 1 0 12:07 ? 00:00:00 /usr/sbin/sshdroot 2362 1771 0 16:34 ? ...
- conda配置python混合开发环境一站式入门【全平台】
下载安装 清华的镜像 [https://mirror.tuna.tsinghua.edu.cn/help/anaconda/] 官方说明 [http://conda.pydata.org/docs/u ...
- 【Chromium中文文档】沙箱FAQ
沙箱FAQ 转载请注明出处:https://ahangchen.gitbooks.io/chromium_doc_zh/content/zh//General_Architecture/Sandbox ...
- modbus rtu 协议转DLT645-2007和DLT645-1997电表协议转换器定制,
现场会碰到现场数据为Modbus协议,但是后台系统为DLT645协议系统,本模块支持将工业ModbusRtu协议转换为电表国标协议DLT645协议,支持1997和2007俩种标准,只需要进行简单的配置 ...
- 0-20ma 0-5V,0-10V ,0-15V ,0-20V,0-30V模拟量(范围可以定制)多功能采集模块,支持1路继电器输出,2路Di输入,8路Ai输入,可电脑控制,支持485 modbus rtu协议。端口参数可以配置保存,支持定制修改。
多功能模拟量采集模块MRD-5017具有8 通道模拟量采集(支持0-20mA,0-5V,0-10V混合测量),2路DI,1路继电器输出,1路485接口(支持MODBUS RTU),能实现8路AI(12 ...