Code Monkey home page Code Monkey logo

pickture's Introduction

Pickture

A small-scale android widget which provides easy attach to photo selection.
q:一个怎样的控件呢?a:照片的选择+照片Gridview展示(拖拽排序、删除)+照片放大显示+照片viewpager演示(放大、缩小)

Intro

  • 场景:社交类、工具类、游戏类App
  • 进度:已完成上述所有功能,有问题可以issue这里
  • 用途:照片的选择、演示
  • 如何使用:目前还在处理Maven仓库的问题,暂时无法提供Library Denpendency

##如何使用呢? ###Scene1. 只用照片选择 调用下面的代码即可进入到照片选择

Pickture.with(MainActivity.this).column(COLUMN).max(MAX).selected(selectedList).create();

column:照片显示的行 max:选择的照片数量 selected:设置已选择的照片

ArrayList<String> selectedList = new ArrayList<>();

在 onActivityResult接收你选择的照片

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (resultCode == RESULT_OK) {

            selectedList = data.getStringArrayListExtra(Pickture.PARAM_PICKRESULT);

            mPickRecyclerView.bind(selectedList);
        }
    }

###Scene2. 使用照片展示的GridView 这个时候需要使用到

import me.stefan.pickturelib.widget.PickRecyclerView;

具体使用方式为:

        mPickRecyclerView = (PickRecyclerView) findViewById(R.id.__prv);

        findViewById(R.id.__get_photo_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //启用图片选择功能
                mPickture.selected(selectedList).create();

            }
        });

        mPickture = Pickture.with(MainActivity.this).column(COLUMN).max(MAX).hasCamera(true).selected(selectedList);

        //当需要同步展示到 PickRecyclerView 需要同步基础参数给你的 mPickRecyclerView ,这个方法就是用于同步的
        mPickture.showOn(mPickRecyclerView);

        mPickRecyclerView.setOnOperateListener(new OperateListenerAdapter() {

            @Override
            public void onClickAdd() {
                //点击添加按钮
                mPickture.selected(selectedList).create();
            }
        });

xml中的文件就是正常的控件使用方式,就不贴出啦

效果图

Pickture

APK下载

THE END

  • 项目里面的一些实现借鉴了github上的一些图片选择库,非常感谢他们共享了这些资源
  • 如果有技术合作欢迎联系我
  • 如果有bug,麻烦您在issues及时反馈,我也将在第一时间进行处理
  • 如何联系我:[email protected]
  • 有任何问题可以留言给我,一个人的力量是有限的,有你们的支持才能让它更加useful,提前谢谢你们的star~

License

Copyright (C) 2016 JmStefanAndroid

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.

pickture's People

Contributors

jmstefanandroid avatar

Watchers

 avatar  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.