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

<activityandroid: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 athttp://www.apache.org/licenses/LICENSE-2.0Unless 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.

转载于:https://www.cnblogs.com/Free-Thinker/p/4203470.html

MediaChooser图库浏览器相关推荐

  1. 开源集锦(五)开源框架和快速开发工具类

    Volley https://github.com/stormzhang/AndroidVolley http://blog.csdn.net/t12x3456/article/details/922 ...

  2. Apple Final Cut Pro 10.4.8

    软件下载 Final Cut Pro 10.4.8下载:https://www.macapp.so/final-cut-pro/ 软件介绍 Final Cut Pro 10.4.8是一款用于创建.编辑 ...

  3. Final Cut Pro X 10.4.8 Apple出品的专业视频非线性编辑软件

    Final Cut Pro 10.4.8 版经过完整而彻底的重新设计后,为后期制作工作流程的方方面面增添了无与伦比的速度.质量和灵活性.Final Cut Pro 将革命性的视频编辑与强大的媒体整理和 ...

  4. Stable Diffusion使用入门教程

    本文参考bilibili的链接:B站第一套系统的AI绘画课!零基础学会Stable Diffusion,这绝对是你看过的最容易上手的AI绘画教程 | SD WebUI 保姆级攻略_哔哩哔哩_bilib ...

  5. Final Cut Pro X 苹果视频剪辑软件

    现在网上下载个软件太难太难了,很多都是收费的,,,,终于找到一个免费的,分享给坛子里的童鞋,人格担保完全是免费的! 需要的童鞋自取吧!地址看后面. Apple Final Cut Pro X 苹果视频 ...

  6. Stable Diffusion系列课程上:安装、提示词入门、常用模型(checkpoint、embedding、LORA)、放大算法、局部重绘、常用插件

    文章目录 一.Stable Diffusion简介与安装 二.文生图(提示词解析) 2.1 提示词入门 2.2 权重 2.3 负面提示词( Negative prompt) 2.4 出图参数设置 2. ...

  7. Neo4j ① <图论>图,节点,关系,属性<知识图谱和图库>图谱,图库,优势<基础>模块,应用场景,环境搭建,浏览器

    目录 第一部分 图 和 Neo4j 1.1 图论 1.1.1 图论起源 --- 柯尼斯堡(Konigsberg)七桥问题 1.1.2 图 和 节点 1.1.3 节点关系表达 1.1.4 属性图模型规则 ...

  8. 如何快速设计元器件原理图库和PCB封装库?

    目录 1.立创商城EDA免费库 2.Altium Library Loader 3.贸泽电子ECAD模型 在设计电路的过程中经常会遇到这样的问题:无法快速找到合适的元器件原理图封装和PCB封装(Foo ...

  9. python各个绘图的作用,深度讲解Python四大常用绘图库的“绘图原理”

    转自:数据分析与统计学之美 为什么要写这篇文章? 最近有不少粉丝来问我,Python绘图库太多,我知不知道学哪一个?即使我选择了某一个绘图库后,我也不知道怎么学,我不知道第一步做什么,也不知道接下来该 ...

  10. 组态王浏览器java_1工程浏览器是组态王的集成开发环境在这里可以

    您所在位置:网站首页 > 海量文档 &nbsp>&nbsp计算机&nbsp>&nbsp软件工程 1工程浏览器是组态王的集成开发环境在这里可以3页 本文 ...

最新文章

  1. 5G 信令流程 — MM 定时器
  2. 【IT笔试面试题整理】字符串的排列
  3. yolov5训练_YoloV5模型训练实战教程:Kaggle全球小麦检测竞赛
  4. SIFT特征提取-应用篇
  5. C/C++ 语言中的表达式求值
  6. 《网络编程》ioctl 操作
  7. 操作12864(ST7920控制器)
  8. Python3 爬虫学习笔记 C03 【Ajax 数据爬取】
  9. 【LeetCode笔记】剑指 Offer 03. 数组中重复的数字(Java、哈希表、原地算法)
  10. ajax结构图,Vuex结构图及用法
  11. UI图标设计素材|风格多样的图标
  12. Excel删除重复数据
  13. CDOJ 485 UESTC 485 Game (八数码变形,映射,逆cantor展开)
  14. Python处理Excel数据的方法
  15. 机房(计算机室)管理制度,湖南石油化工职业技术学院-信息资源中心-管理制度-计算机机房管理制度...
  16. 【ESP 保姆级教程】疯狂点灯篇 —— 案例:ESP8266 + LED + 按键 + 阿里云物联网平台 + 阿里云物联网Web应用(详细操作过程,全部源码)
  17. macbook双系统怎么装mysql_mac电脑安装window双系统方法和注意事项
  18. java毕业设计产品销售管理系统Mybatis+系统+数据库+调试部署
  19. Caused by: java.lang.IllegalStateException: No ServletContext set
  20. 皇帝成长计划html文件打不开,皇帝成长计划源代码修改(共6篇).doc

热门文章

  1. webservice 接口配置_springboot整合WebService简单版
  2. 实现关于跨二级域名和1.1和2.0版.net Forms身份验证体制的问题和解决办法.
  3. 物联网发展 制定技术标准才能更好监管
  4. Linux下互斥量加锁与解锁操作的C代码实现
  5. pytorch forward
  6. Linux --- 常用命令
  7. Android内存泄漏(转)
  8. monkey4444勒索病毒解密方法方案成功处理复旦安全实验室
  9. 转载:Charles 使用过程中遇到问题
  10. 矩表 - 现代数据分析中必不可少的报表工具