# PhotographyMaster **Repository Path**: ZBL-Kiven/PhotographyMaster ## Basic Information - **Project Name**: PhotographyMaster - **Description**: 自定义Android相册,支持文件分类、多选、复选、排序、大图预览、幻灯片预览、大图Banner预览、手势拉伸等功能,使用简单; - **Primary Language**: Android - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2018-07-10 - **Last Updated**: 2023-01-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AlbumMaster #### The use of a preface to a custom album /** * * you must set your cacheName in Constance.homeCache,it is the firstName with all your photoCache. * * if you started Photograph Activity , you need define your cacheNameCode. * * finally , it will make a directory names :firstName_cacheNameCode. * * @see Method: * * PhotoTemporaryCache.getCacheImages( your cacheNameCode); * * you can get a URI list , the list items was all your selected in PhotographActivity; * * if you have some photos and you want save or use with an RecyclerView, * * you can put those picture URI in PhotographHelper to cache , example you take a picture. * * you can use photo graph in another progress , it will be better for your memory use; * * first,you should compile @see ProcessUtils in your application; * * then,set your cache name in cache-PhotoCacheUtils-CacheHome. */ ### 自定义相册说明: ##### 这个模块是我为某个项目的需求所开发的,多数团队可能会遇见类似要求做相册选择、预览、上传的需求,故分享出来,希望大家可以多多提意见; ##### 此模块支持IPC,支持多进程启动,节约内存资源; ##### 此模块运行时需要Read_external_Storage 权限; ##### 模块支持相册文件分类、多选、复选、排序、大图预览、幻灯片预览、大图Banner预览、手势拉伸等功能; ##### 已为该模块设计内存回收机制,该模块可流畅运行于200M小内存的老式Android机上; ##### 模块兼容区间 Android 2.2 - newest(持续更新); #### 模块依赖: ##### picasso(列表图片显示) fresco(预览图显示) fastJson(序列化javaBean,用于转储加密等) ### 使用说明: Intent intent = new Intent(this, PhotoGraphActivity.class); intent.putExtra("max",int maxNum); intent.putExtra("cacheNameCode", String "cacheNameCode"); startActivity(intent); ###### 如上,直接跳转Activity即可,参数说明如下: ###### "max" : 最大允许选择张数,超过这个数量就选不了了; ###### "cacheNameCode" :非常重要的一个参数,因为你获取已选择的图片时,用的就是它; ### 获取选择的图片: ##### 不管在相册还是预览界面,只有当你点击了【完成】按钮时,本次选择才会生效; ##### 获取相册可以通过Activity、Fragment的Resume(),View的onFocusChange等自带或其它自定义函数, ##### eg:获取方式如下(以Activity举例): @Override protected void onResume() { super.onResume(); List infos = PhotoTemporaryCache.getCacheImages(cacheNameCode); } } ###### 当然,还可以使用IPC实现自定义函数的回调,不过绝大多数情况下都并不需要去灵敏监听跨进程的响应; ###### 使用方式很简单,PhotoInfo为单个相片信息,包含URI、State、index等信息,其中index为排序序号; ##### 以上内容完全开源,大家可根据自己的项目需求自行修改,欢迎fork,若有疑问欢迎留言咨询;