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天自制原子弹的姐妹篇 ...
随机推荐
- json概述及python处理json等数据类型
<一,概念> 序列化(Serialization):将对象的状态信息转换为可以存储或可以通过网络传输的过程,传输的格式可以是JSON.XML等.反序列化(deserialization): ...
- cf公式专场-续
Benches Time Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Statu ...
- 步步学LINQ to SQL:为实体类添加关系【转】
[IT168 专稿]本文详细为你阐述了如何在你的应用程序中实现LINQ to SQL.附件的示例程序包括了这里探讨的所有代码,还提供了一个简单的WPF图形界面程序来显示通过数据绑定返回的结果集. 第一 ...
- Android(一)
Android Activity TextView,Button 1.在fragment_main.xml文件中直接添加控件 2.在MainActivity.java文件中添加TextView控件 在 ...
- HTML 基础 1
1. 文件结构: HTML文件的固定结构: <html> <head>...</head> <body>...</body> </ht ...
- T-SQL索引
索引 使用索引可以提高查询速度,不是越多越好,会损耗存储空间.应用于出现在where子句中的列建立索引.可以使用sql server 内置工具Profiler捕捉在SQL Server实例上执行的活动 ...
- Position详解---转
position有四个属性值: relative absolute fixed static 下面分别讲述这四个属性. 1. relative relative属性,相对定位,我们要搞清它是相对哪个对 ...
- winow.open打开窗口被拦截的解决方法
自己遇到的使用window.open打开新窗口被拦截的几种情况(使用的chrome浏览器,其他浏览器未测): 第一次:window.open("www.baidu.com"),打开 ...
- [Linked List]Delete Node in a Linked List
otal Accepted: 48115 Total Submissions: 109291 Difficulty: Easy Write a function to delete a node (e ...
- EC读书笔记系列之18:条款47、48
条款47 请使用traits classes表现类型信息 记住: ★Traits classes使得“类型相关信息”在编译期可用.它们以templates和“templates特化”完成实现 ★整合重 ...