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天自制原子弹的姐妹篇 ...
随机推荐
- [置顶] mkdir函数-linux
tyle="margin:20px 0px 0px; font-size:14px; line-height:26px; font-family:Arial">
- 打包静态库.a文件的方法(ar,ranlib,nm命令介绍)
一 常用脚本 1 打包脚本 脚本如下,下面附上ar 和 ranlib命令参考(命令来自于网络) ALLLIB=*.aFILE=`ls *.a`#原来的库解压重命名 for F in $FILEdo ...
- 网易云课堂_C++程序设计入门(上)_第6单元:丹枫虽老犹多态–继承与多态_第6单元作业【2】- 在线编程(难度:中)
第6单元作业[2]- 在线编程(难度:中) 查看帮助 返回 温馨提示: 1.本次作业属于Online Judge题目,提交后由系统即时判分. 2.学生可以在作业截止时间之前不限次数提交答案,系统 ...
- 调用Response.Redirect 捕获异常 解决办法(摘抄)
如果使用 Response.End.Response.Redirect 或 Server.Transfer 方法,将出现 ThreadAbortException 异常.您可以使用 try-catch ...
- T-SQL视图
视图(view) 用于存储封装一个select语句,使用方法和表一样.也可通过界面对视图进行操作. create view ordersWithNum --创建一个视图ordersWithNum as ...
- ssh框架搭建时报错
java.lang.UnsupportedClassVersionError: com/microsoft/ sqllserver/ jdbc/SQLServerDriver : Unsupport ...
- iOS8毛玻璃效果
UIBlurEffect*blueEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; UIVisualEffectView* ...
- iOS集成微信支付
微信支付的开发 前言:之前听说过微信支付有很多坑,其实没有想象的那么坑,整体感觉很容易上手,按照它的流程来不会有错!PS:官方的流程看的TMD烦,好啦,废话有点多,进入开发.(ps:每个微信的版本一直 ...
- Spring-----3、Spring的核心机制(依赖注入)
转载自:http://blog.csdn.net/hekewangzi/article/details/41345237
- 几种画直线的方法-孙鑫C++笔记
// HDC画直线 CPoint m_ptOrigin ; void CDrawView::OnLButtonDown(UINT nFlags, CPoint point) { m_ptOrigin ...