Simple Photo Picker

Photo picker library for Android application

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

io.github.shygiants
ArtifactId

ArtifactId

simple-photo-picker
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

Simple Photo Picker
Photo picker library for Android application
Project URL

Project URL

https://github.com/shygiants/Simple-Photo-Picker
Source Code Management

Source Code Management

https://github.com/shygiants/Simple-Photo-Picker

Download simple-photo-picker

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.shygiants/simple-photo-picker/ -->
<dependency>
    <groupId>io.github.shygiants</groupId>
    <artifactId>simple-photo-picker</artifactId>
    <version>1.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.github.shygiants/simple-photo-picker/
implementation 'io.github.shygiants:simple-photo-picker:1.0.1'
// https://jarcasting.com/artifacts/io.github.shygiants/simple-photo-picker/
implementation ("io.github.shygiants:simple-photo-picker:1.0.1")
'io.github.shygiants:simple-photo-picker:aar:1.0.1'
<dependency org="io.github.shygiants" name="simple-photo-picker" rev="1.0.1">
  <artifact name="simple-photo-picker" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.github.shygiants', module='simple-photo-picker', version='1.0.1')
)
libraryDependencies += "io.github.shygiants" % "simple-photo-picker" % "1.0.1"
[io.github.shygiants/simple-photo-picker "1.0.1"]

Dependencies

compile (5)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 22.2.1
com.jakewharton : butterknife jar 7.0.1
com.android.support » recyclerview-v7 jar 22.2.1
com.android.support » cardview-v7 jar 22.2.1
com.android.support » design jar 22.2.1

Project Modules

There are no modules declared in this project.

Simple Photo Picker

Simple Photo Picker는 간단하게 Android 기기의 사진들을 보여주고 선택하도록 하는 라이브러리입니다.

Pick single photo

Pick multiple photos

Quick Start

  • PhotoPickerActivity를 시작하는 Intent를 생성합니다.
  • IntentPhotoPickerActivity.ARG_IS_MULTIPLE을 key로 multiple 옵션을 설정합니다. (default는 single)
  • onActivityResult()에서 PhotoPickerResultResolver를 이용하여 PhotoPickerActivity의 결과를 처리합니다.

사진 여러 개 고르기

public class ExampleActivity extends Activity {
  private final static int REQ_PICK_PHOTOS = 1;

  void startPhotoPickerActivity() {
    Intent intent = new Intent(this, PhotoPickerActivity.class);
    intent.putExtra(PhotoPickerActivity.ARG_IS_MULTIPLE, true);
    startActivityForResult(intent, REQ_PICK_PHOTOS);
  }

  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQ_PICK_PHOTOS && resultCode == RESULT_OK)
      List<Photo> photosPicked = PhotoPickerResultResolver.resolve(data);
  }
}

사진 하나 고르기

public class ExampleActivity extends Activity {
  private final static int REQ_PICK_PHOTO = 1;

  void startPhotoPickerActivity() {
    Intent intent = new Intent(this, PhotoPickerActivity.class);
    intent.putExtra(PhotoPickerActivity.ARG_IS_MULTIPLE, false);
    startActivityForResult(intent, REQ_PICK_PHOTO);
  }

  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQ_PICK_PHOTO && resultCode == RESULT_OK)
      Photo photoPicked = PhotoPickerResultResolver.resolve(data).get(0);
  }
}

Photo 클래스

ImageView imageView = (ImageView) findViewById(R.id.image_view);
ImageView thumbnailView = (ImageView) findViewById(R.id.thumbnail_view);

// onActivityResult()에서 Photo 객체를 얻었다고 가정합니다.
Photo photoPicked = PhotoPickerResultResolver.resolve(data).get(0);
Uri imageUri = photoPicked.getImageUri();
Uri thumbnailUri = photoPicked.getThumbnailUri();

// ImageView 설정
imageView.setImageURI(imageUri);
thumbnailView.setImageURI(thumbnailUri);

// Uri에서 File 객체 생성
File file = new File(imageUri.getPath());

자세한 사용법은 Sample을 참고해주세요.

Download

Download 또는

Gradle

compile 'io.github.shygiants:simple-photo-picker:1.0.3'

Simple Photo Picker는 최소 Android 5.0.1 Lollipop(API 21)을 요구합니다.

Credits

License

Copyright 2016 Sanghun Yun

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.

Versions

Version
1.0.1