项目作者: r00786

项目描述 :
Gallery like Whatsapp which comes from bottom and opens till top with sticky headers
高级语言: Java
项目地址: git://github.com/r00786/Custom-Gallery.git
创建时间: 2018-07-04T11:04:19Z
项目社区:https://github.com/r00786/Custom-Gallery

开源协议:

下载


Custom Gallery

Gallery like Whatsapp which comes from bottom and opens till top with sticky headers
You can add it to your application using the following

In project level gradle file

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

In module level build file

  1. dependencies {
  2. implementation('com.github.r00786:Custom-Gallery:2.0.9') {
  3. exclude group: 'com.android.support'
  4. exclude group: 'com.github.bumptech.glide'
  5. }
  6. }

Usage

for opening gallery or camera

  1. // first param context
  2. //second param request code which you will use for receiving result
  3. //third param is a boolean put true if you want to open gallery and false if you want to open camera
  4. //selection count is the number of count you allow a user to select images at a time
  5. GalleryAct.openGallery(this, 101, true, 1);
  1. @Override
  2. protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  3. super.onActivityResult(requestCode, resultCode, data);
  4. if (requestCode == REQ_CODE && resultCode == Activity.RESULT_OK && data != null) {
  5. ArrayList<String> imagePath = data.getStringArrayListExtra(GalleryAct.IMAGE_KEY);
  6. ivSample.setImageURI(Uri.parse(imagePath.get(0)));
  7. }
  8. }