同步操作将从 sleepingAnt/MultiImageSelector 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
仿微信实现多图选择。支持单选和多选两种模式
###截图
###运行DEMO
./gradlew installDebug
###快速开始
第0步
把模块 multi-image-selector
作为你的项目依赖添加到工程中.
第1步
在你的 AndroidManifest.xml
文件中添加权限 android.permission.READ_EXTERNAL_STORAGE
.
别忘了同时在 AndroidManifest.xml
中声明 MultiImageSelectorActivity
和PreviewPicturesActivity
这两个Activity.
<activity
android:name="me.nereo.multi_image_selector.PreviewPicturesActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name="me.nereo.multi_image_selector.MultiImageSelectorActivity"
android:configChanges="orientation|screenSize" />
//yourActivity-Activity,requestCode-requestCode,maxNum-最多选择的图片数,selectedMode-选择模式(单选/多选)
MultiImageSelectorActivity.startSelect(yourActivity, requestCode, maxNum, selectedMode);
onActivityResult
方法中接受结果. 例如:@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == REQUEST_IMAGE){
if(resultCode == RESULT_OK){
// 获取返回的图片列表
List<String> path = data.getStringArrayListExtra(MultiImageSelectorActivity.EXTRA_RESULT);
// 处理你自己的逻辑 ....
}
}
}
MultiImageSelectorActivity.java
的实现###感谢
###License
The MIT License (MIT)
Copyright (c) 2015 Nereo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。