All Projects → JmStefanAndroid → Pickture

JmStefanAndroid / Pickture

A small-scale android widget which provides easy attach to photo selection(拍照、照片选择+照片Gridview展示(拖拽排序、删除)+照片viewpager演示(放大、缩小))

Programming Languages

java
68154 projects - #9 most used programming language

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].