Giter VIP home page Giter VIP logo

photoprocessor's Introduction

###说明### 本demo的编写是为了实现android端的拍照+图片选择+裁剪+压缩+预览(手势缩放)功能, 集成了开源项目matisse && ucrop && luban && PhotoView 并做了一定的封装.

项目内部采用RxJava事件流**处理 图片选择(拍照) -- 压缩 -- 裁剪 的整套流程.

###典型用法###

1.在业务Activity中初始化ImageManager: mSelectManager = ImageManager.getInstance(this, selectConfig, null, null);

2.调用ImageManager的api mSelectManager.pickFromGallary(); 或 mSelectManager.pickAndCrop();

3.在业务Activity#onActivityResult()回调监听图片选择()事件

mSelectManager.onActivityResult(requestCode, resultCode, data) .observeOn(AndroidSchedulers.mainThread()) .subscribe();

具体使用细节请参考本demo的MainActivity

###踩坑记录###

1.ucrop bottom bar 控件颜色无法通过api来设置, 必须通过colors.xml的方式配置.

解决方案: Yalantis/uCrop#520 saidavdic的答案

2.matisse 在android7.0+的设备必须在manifest中添加fileprovider, 并在res/xml中添加file_paths_private.xml file_paths_public.xml 文件. 另外, matisse#captureStratety()也会使用manifest中定义的provider. Matisse.captureStrategy(new CaptureStrategy(true, "me.jessefu.matissedemo.fileprovider", null))

3.photoView集成2.3.0版本会报manifest merge failed, 原因是2.3.0版本必须使用androidx. 未迁移到androidx的项目, 解决方案是import低版本的photoView(2.1.5)

参考链接: Baseflow/PhotoView#654

photoprocessor's People

Contributors

jesse920524 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.