All Projects → yanzhenjie → Album

yanzhenjie / Album

Licence: apache-2.0
🍉 Album and Gallery for Android platform.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Album

Ptimagealbumviewcontroller
"Image Album" — or "Photo Album" if you like that better — View( Controller) for all crazy iOS developers out there...
Stars: ✭ 199 (-91.81%)
Mutual labels:  image, gallery, album
Croperino
📷 A simple image cropping tool that provides gallery or camera help for Native Android (Java)
Stars: ✭ 176 (-92.76%)
Mutual labels:  camera, image, gallery
Album
android 图片视频加载库,单选,多选,预览,自定义UI,相机,裁剪...等等 已适配android10,11
Stars: ✭ 53 (-97.82%)
Mutual labels:  gallery, camera, album
Ptshowcaseviewcontroller
An initial implementation of a "showcase" view( controller) for iOS apps... Visualizes images, videos and PDF files beautifully! (by @pittleorg) [meta: image, photo, video, document, pdf, album, gallery, showcase, gallery, iOS, iPhone, iPad, component, library, viewer]
Stars: ✭ 395 (-83.74%)
Mutual labels:  image, gallery, album
Telegramgallery
world level Gallery , from Telegram,Photo album selector,QQ style
Stars: ✭ 1,294 (-46.75%)
Mutual labels:  gallery, album
Rximagepicker
Android图片相册预览选择器、支持AndroidX,支持图片的单选、多选、图片预览、图片文件夹切换、在选择图片时调用相机拍照
Stars: ✭ 85 (-96.5%)
Mutual labels:  camera, image
V Viewer
Image viewer component for vue, supports rotation, scale, zoom and so on, based on viewer.js
Stars: ✭ 1,776 (-26.91%)
Mutual labels:  image, gallery
Stfalconimageviewer
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures
Stars: ✭ 1,734 (-28.64%)
Mutual labels:  image, gallery
Android Image Picker
Image Picker for Android 🤖
Stars: ✭ 847 (-65.14%)
Mutual labels:  camera, gallery
Imageslideshow
Swift image slideshow with circular scrolling, timer and full screen viewer
Stars: ✭ 1,612 (-33.66%)
Mutual labels:  image, gallery
Pictureselectorlight
Picture Selector Library for Android or 图片选择器
Stars: ✭ 145 (-94.03%)
Mutual labels:  camera, image
Picker
Picker - A CameraX based WhatsApp Style Image-Video Picker
Stars: ✭ 69 (-97.16%)
Mutual labels:  camera, image
Imageviewer.swift
An easy to use Image Viewer that is inspired by Facebook
Stars: ✭ 1,071 (-55.93%)
Mutual labels:  image, gallery
Albumcamerarecorder
一个高效的多媒体支持操作库,可多方面的简单配置操作相册、拍照、录制、录音等功能。也支持配套使用的展示图片、视频、音频的九宫格功能。 (An efficient multimedia support operation library, can be a variety of simple configuration operation album, photo, recording, recording and other functions.Also support supporting the use of the display of pictures, video, audio of the nine grid function.)
Stars: ✭ 106 (-95.64%)
Mutual labels:  camera, album
React Grid Carousel
React responsive carousel component w/ grid layout
Stars: ✭ 29 (-98.81%)
Mutual labels:  image, gallery
Xzoom
jQuery Zoom Gallery plugin
Stars: ✭ 120 (-95.06%)
Mutual labels:  image, gallery
Gpuimage X
A Cross-platform (for both Android & iOS) Framework for GPU-based Filters, Video and Image Processing.
Stars: ✭ 154 (-93.66%)
Mutual labels:  camera, image
Recent Images
Do you noticed the new feature of Telegram or Instagram?! They show your latest images when you try to attach or post a picture. So I developed this library the same with lots of customization. Simple way to get all images of device based on date taken, name, id and other customization
Stars: ✭ 182 (-92.51%)
Mutual labels:  image, gallery
Cdpimagecrop
CDPImageCrop can zoom,move and crop a image and automatically save into the album,details see demo.
Stars: ✭ 6 (-99.75%)
Mutual labels:  image, album
Gallery
图片缩放以及相册的实现
Stars: ✭ 24 (-99.01%)
Mutual labels:  gallery, album

Album

Album is a Material Design style album, it provides three functions: album, camera and gallery.

  1. Select images, selecte videos, or select pictures and videos.
  2. Take a picture, record a video, or use camera in album list.
  3. Preview pictures and videos in the gallery or select pictures and videos in the gallery.

Screenshot

White StatusBar, the left is the effect of 5.0-(Containing 5.0), the right is the effect of 6.0+(Containing 6.0):

Effect on landscape screen:

Download

implementation 'com.yanzhenjie:album:2.1.3'

Usage

Developers must configure AlbumLoader to make Album work normally, and AlbumLoader is used to load thumbnails of images and videos.

This is an example:

public class MediaLoader implements AlbumLoader {

    @Override
    public void load(ImageView imageView, AlbumFile albumFile) {
        load(imageView, albumFile.getPath());
    }

    @Override
    public void load(ImageView imageView, String url) {
        Glide.with(imageView.getContext())
                .load(url)
                .error(R.drawable.placeholder)
                .placeholder(R.drawable.placeholder)
                .crossFade()
                .into(imageView);
    }
}

The example uses Glide to load thumbnails of pictures and videos. Please remember to configure the AlbumLoader you just implemented.

Album.initialize(AlbumConfig.newBuilder(this)
    .setAlbumLoader(new MediaLoader())
    ...
    .build());

Image and video mix options

Album.album(this) // Image and video mix options.
    .multipleChoice() // Multi-Mode, Single-Mode: singleChoice().
    .columnCount() // The number of columns in the page list.
    .selectCount()  // Choose up to a few images.
    .camera() // Whether the camera appears in the Item.
    .cameraVideoQuality(1) // Video quality, [0, 1].
    .cameraVideoLimitDuration(Long.MAX_VALUE) // The longest duration of the video is in milliseconds.
    .cameraVideoLimitBytes()(Long.MAX_VALUE) // Maximum size of the video, in bytes.
    .checkedList() // To reverse the list.
    .filterSize() // Filter the file size.
    .filterMimeType() // Filter file format.
    .filterDuration() // Filter video duration.
    .afterFilterVisibility() // Show the filtered files, but they are not available.
    .onResult(new Action<ArrayList<AlbumFile>>() {
        @Override
        public void onAction(@NonNull ArrayList<AlbumFile> result) {
            // TODO accept the result.
        }
    })
    .onCancel(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
            // The user canceled the operation.
        }
    })
    .start();

Image Selection

Album.image(this) // Image selection.
    .multipleChoice()
    .camera()
    .columnCount()
    .selectCount()
    .checkedList(mAlbumFiles)
    .filterSize() // Filter the file size.
    .filterMimeType() // Filter file format.
    .afterFilterVisibility() // Show the filtered files, but they are not available.
    .onResult(new Action<ArrayList<AlbumFile>>() {
        @Override
        public void onAction(@NonNull ArrayList<AlbumFile> result) {
        }
    })
    .onCancel(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
        }
    })
    .start();

If developer want to crop the image, please use Durban.

Video Selection

Album.video(this) // Video selection.
    .multipleChoice()
    .camera(true)
    .columnCount(2)
    .selectCount(6)
    .checkedList(mAlbumFiles)
    .filterSize()
    .filterMimeType()
    .filterDuration()
    .afterFilterVisibility() // Show the filtered files, but they are not available.
    .onResult(new Action<ArrayList<AlbumFile>>() {
        @Override
        public void onAction(@NonNull ArrayList<AlbumFile> result) {
        }
    })
    .onCancel(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
        }
    })
    .start();

Take Picture

Album.camera(this) // Camera function.
    .image() // Take Picture.
    .filePath() // File save path, not required.
    .onResult(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
        }
    })
    .onCancel(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
        }
    })
    .start();

If developer want to crop the image, please use Durban.

Record Video

Album.camera(this)
    .video() // Record Video.
    .filePath()
    .quality(1) // Video quality, [0, 1].
    .limitDuration(Long.MAX_VALUE) // The longest duration of the video is in milliseconds.
    .limitBytes(Long.MAX_VALUE) // Maximum size of the video, in bytes.
    .onResult(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
        }
    })
    .onCancel(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
        }
    })
    .start();

Gallery

// Preview AlbumFile:
Album.galleryAlbum(this)
...

// Preview path:
Album.gallery(this)
    .checkedList(imageList) // List of image to view: ArrayList<String>.
    .checkable(true) // Whether there is a selection function.
    .onResult(new Action<ArrayList<String>>() { // If checkable(false), action not required.
        @Override
        public void onAction(@NonNull ArrayList<String> result) {
        }
    })
    .onCancel(new Action<String>() {
        @Override
        public void onAction(@NonNull String result) {
        }
    })
    .start();

If checkable(false), listener not required, the CheckBox and the FinishButton will be not appear.

The user may click or long press on the preview image and the developer can listen to both events:

Album.gallery(this)
    ...
    .itemClick(new ItemAction<String>() {
        @Override
        public void onAction(Context context, String item) {
        }
    })
    .itemLongClick(new ItemAction<String>() {
        @Override
        public void onAction(Context context, String item) {
        }
    })
    .start();

Capabilities of AlbumFile

AlbumFile is the result of the selection of images and videos, The properties of the image and video are different, and their different attributes are listed below.

Image

public int getMediaType(); // File type, the image is AlbumFile.TYPE_IMAGE.
public String getPath(); // File path, must not be empty.
public String getBucketName(); // The name of the folder where the file is located.
public String getMimeType(); // File MimeType, for example: image/jpeg.
public long getAddDate(); // File to add date, must have.
public float getLatitude(); // The latitude of the file, may be zero.
public float getLongitude(); // The longitude of the file, may be zero.
public long getSize(); // File size in bytes.
public String getThumbPath(); // This is a small thumbnail.

Video

public int getMediaType(); // File type, the video is AlbumFile.TYPE_VIDEO.
public String getPath(); // File path, must not be empty.
public String getBucketName(); // The name of the folder where the file is located.
public String getMimeType(); // File MimeType, for example: image/jpeg.
public long getAddDate(); // File to add date, must have.
public float getLatitude(); // The latitude of the file, may be zero.
public float getLongitude(); // The longitude of the file, may be zero.
public long getSize(); // File size in bytes.
public long getDuration(); // Video duration, must have.
public String getThumbPath(); // This is a small thumbnail.

Customize UI

Through Widget, developer can configure the title, color of StatusBar, color of NavigationBar and so on.

// Such as image video mix:
 Album.album(this)
    .multipleChoice()
    .widget(...)
    ...

// Image selection:
Album.image(this)
    .multipleChoice()
    .widget(...)
    ...

// Video selection:
Album.video(this)
    .multipleChoice()
    .widget(...)
    ...

// Gallery, preview AlbumFile:
Album.galleryAlbum(this)
    .widget(...)
    ...

// Gallery, preview path:
Album.gallery(this)
    .widget(...)
    ...

So we only need to pass in a Widget parameter just fine:

// StatusBar is a dark background when building:
Widget.newDarkBuilder(this)
...

// StatusBar is a light background when building:
Widget.newLightBuilder(this)
...

// Such as:
Widget.xxxBuilder(this)
    .title(...) // Title.
    .statusBarColor(Color.WHITE) // StatusBar color.
    .toolBarColor(Color.WHITE) // Toolbar color.
    .navigationBarColor(Color.WHITE) // Virtual NavigationBar color of Android5.0+.
    .mediaItemCheckSelector(Color.BLUE, Color.GREEN) // Image or video selection box.
    .bucketItemCheckSelector(Color.RED, Color.YELLOW) // Select the folder selection box.
    .buttonStyle( // Used to configure the style of button when the image/video is not found.
        Widget.ButtonStyle.newLightBuilder(this) // With Widget's Builder model.
            .setButtonSelector(Color.WHITE, Color.WHITE) // Button selector.
            .build()
    )
    .build()

Configuration language

Album defaults to English and changes with the system language. Unfortunately, Album only supports English, Simplified Chinese, Traditional Chinese and Portuguese. However, developers can copy the items in Album's string.xml into your project for translation, the best thing is that you can contribute and submit pull requests to perfect Album.

Developers can specify Album's language:

Album.initialize(AlbumConfig.newBuilder(this)
    ...
    .setLocale(Locale.ENGLISH)
    .build());

Contributing

Before submitting pull requests, contributors must abide by the agreement .

Proguard-rules

If you are using ProGuard you might need to add the following options:

-dontwarn com.yanzhenjie.album.**
-dontwarn com.yanzhenjie.mediascanner.**

License

Copyright 2017 Yan Zhenjie

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].