logo.png
Phoenix
功能介绍
项目地址:https://github.com/guoxiaoxing/phoenix


</p>
功能
- 拍照
- 图片选择
- 图片预览
- 图片压缩
- 图片标记、贴图、涂抹与裁剪
- 视频选择
- 视频预览
- 视频压缩
<p align="center">




</p>
主题
- 默认主题
- 橙色主图
- 红色主题
- 蓝色主题
<p align="center">




</p>
快递开始
添加依赖
在项目根目录build.gradle文件里添加
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
添加依赖
//图片/视频选择、拍照、图片/视频预览
compile 'com.github.guoxiaoxing.phoenix:phoenix-ui:0.0.11'
//选填 - 图片压缩,开启功能:Phoenix.with().enableCompress(true),获取结果:MediaEntity.getCompressPath()
compile 'com.github.guoxiaoxing.phoenix:phoenix-compress-picture:0.0.11'
//选填 - 视频压缩,开启功能:Phoenix.with().enableCompress(true),获取结果:MediaEntity.getCompressPath()
compile 'com.github.guoxiaoxing.phoenix:phoenix-compress-video:0.0.11'
调用功能
Phoenix.with()
.theme(PhoenixOption.THEME_DEFAULT)// 主题
.fileType(MimeType.ofAll())//显示的文件类型图片、视频、图片和视频
.maxPickNumber(10)// 最大选择数量
.minPickNumber(0)// 最小选择数量
.spanCount(4)// 每行显示个数
.pickMode(PhoenixConstant.MULTIPLE)// 多选/单选
.enablePreview(true)// 是否开启预览
.enableCamera(true)// 是否开启拍照
.enableAnimation(true)// 选择界面图片点击效果
.enableCompress(true)// 是否开启压缩
.thumbnailHeight(160)// 选择界面图片高度
.thumbnailWidth(160)// 选择界面图片宽度
.enableClickSound(true)//ƒ 是否开启点击声音
.pickedMediaList(pickList)// 已选图片数据
.videoSecond(0)//显示多少秒以内的视频
.onPickerListener(new OnPickerListener() {
@Override
public void onPickSuccess(List<MediaEntity> pickList) {
adapter.setList(pickList);
adapter.notifyDataSetChanged();
}
@Override
public void onPickFailed(String errorMessage) {
}
}).start(MainActivity.this, PhoenixOption.TYPE_PICK_MEDIA);
最后的start()方法用来完成启动某项功能,根据type不同启动不同的功能,具体含义如下:
//功能 - 选择图片/视频/音频
public static final int TYPE_PICK_MEDIA = 0x000001;
//功能 - 拍照
public static final int TYPE_TAKE_PICTURE = 0x000002;
//功能 - 预览
public static final int TYPE_BROWSER_PICTURE = 0x000003;
更新日志
贡献代码
欢迎加入改进本项目
License
Copyright 2017 Guoxiaoxing
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.
网友评论