项目作者: lhoyong

项目描述 :
Android image picker
高级语言: Kotlin
项目地址: git://github.com/lhoyong/ImagePicker.git
创建时间: 2019-06-17T15:01:45Z
项目社区:https://github.com/lhoyong/ImagePicker

开源协议:Apache License 2.0

下载


ImagePickerView

DOWNLOAD
Build
Android Arsenal

This is Simple Android ImagePicker Library.

Support DayNight Mode.

OverView

ScreenShot

Setup

Add the dependency

  1. dependencies {
  2. implementation "com.lhoyong:imagepicker:$latestVersion"
  3. }

Usage

Add ImagePickerView your Activity or Fragments Example.

When you Click on the Image, it will move to Detail Screen.
If Long Click Image, start scale Animations and visible checkbox. Bul Already Clicked Images, can not move to Detail Screen.

  • Single Select
  1. ImagePickerView.Builder()
  2. .setup {
  3. name { RESULT_NAME }
  4. title { "Image Picker" } // optional
  5. single { true }
  6. }
  7. .start(this)
  • Multiple Select
  1. ImagePickerView.Builder()
  2. .setup {
  3. max { 5} // default 30
  4. name { RESULT_NAME }
  5. title { "Image Picker" } // optional, if not used toolbar title display selected image count
  6. single { false } // optional, single = false
  7. }
  8. .start(this)

Finish image select task, update ui for onActivityResult received data.

  1. override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
  2. super.onActivityResult(requestCode, resultCode, data)
  3. if (resultCode == Activity.RESULT_OK) {
  4. val images = data?.getParcelableArrayListExtra<Uri>(RESULT_NAME)
  5. images?.let {
  6. (recycler_view.adapter as ImageAdapter).submitList(it)
  7. }
  8. }
  9. }

License

  1. Copyright (C) 2020 lhoyong.
  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.