GithubHelp home page GithubHelp logo

00zhengfu00 / avatarstudio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thewyp/avatarstudio

0.0 1.0 0.0 1.64 MB

通用app个人中心头像修改工具,支持拍照、相册、裁剪操作。

Java 100.00%

avatarstudio's Introduction

概要

只需要几句代码就可以实现通用app个人中心头像的修改,支持打开原生相机、从原生相册选取及调用原生裁剪功能,适配android 6.0运行时权限及android 7.0以上,不需要您添加繁琐的FileProvider及xml文件。

download demo apk

 image    image

依赖

dependencies {
                ...
                compile 'me.thewyp:avatar:1.0.4'
           }

使用

new AvatarStudio.Builder(activityContext)
                            .needCrop(true)//是否裁剪,默认裁剪
                            .setTextColor(Color.BLUE)
                            .dimEnabled(true)//背景是否dim 默认true
                            .setAspect(1, 1)//裁剪比例 默认1:1
                            .setOutput(200, 200)//裁剪大小 默认200*200
                            .setText("打开相机", "从相册中选取", "取消")
                            .show(new AvatarStudio.CallBack() {
                                @Override
                                public void callback(String uri) {
                                     //uri为图片路径
                                     Picasso.with(activityContext).load(new File(uri)).into(mImageView);
                                }
                            });

avatarstudio's People

Contributors

thewyp avatar

Watchers

 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.