项目作者: liuzhanta

项目描述 :
Photo image selection activity set library.
高级语言: Java
项目地址: git://github.com/liuzhanta/Vincent.git
创建时间: 2017-06-20T02:15:28Z
项目社区:https://github.com/liuzhanta/Vincent

开源协议:

下载


Vincent

Vincent is a Material-Design local image selector for Android.

Feature:

  • Toolbar and BottomAction Layout behavior;
  • Standard Material Design Components.For example,BottomSheetDialog,Toolbar,RecyclerView and so on;
  • Material Design Transition Animations;
  • Image Auto Fit ScaleType;
  • The Zoomable Gesture used on preview large Image;
  • Preview Larger Image Supported.

Material Design Toolbar
Bottom Sheet Behavior
Preview large Image
Toolbar Scroll Flag

Download

Add the Vincent dependency in your build.gradle.

  1. dependencies {
  2. compile 'com.zterry.imagepicker:Vincent:1.0.0'
  3. }

How do I use Vincent?

Permission

The library requires two permissions:

  • android.permission.READ_EXTERNAL_STORAGE
  • android.permission.WRITE_EXTERNAL_STORAGE

So if you are targeting Android 6.0+, you need to handle runtime permission request before next step.

Simple usage snippet


Start ImagePickerActivity from current Activity:

  1. Vincent.from(this)
  2. .maxSelectCount(9)
  3. .colorPrimary(R.color.colorPrimary)
  4. .titleColor(R.color.colorAccent)
  5. .title(R.string.app_name)
  6. .layoutBehavior(true)
  7. .overMaxSelectCountMessage(R.string.over_max_limit)
  8. .placeHolder(R.drawable.bg_photo_place_holder)
  9. .toPicker();

Themes

You can define your own theme as you wish.

Receive Result

In onActivityResult() callback of the starting Activity or Fragment:

  1. @Override
  2. protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  3. super.onActivityResult(requestCode, resultCode, data);
  4. if (Vincent.hasResult(requestCode, resultCode)) {
  5. List<ImageFile> imageFiles = Vincent.handleActivityResult(data);
  6. for (ImageFile imageFile : imageFiles) {
  7. Log.d(TAG, "onActivityResult: imageFile =" + imageFile);
  8. }
  9. }
  10. }

Developed by

Name: ZTerry Liu
E-mail: tata1989y@gmail.com
Subject: Vincent

License

  1. Copyright 2016 刘战塔
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.