This release is an offshoot of the AndroidX release.Any version number followed by an X is based on the AndroidX version.
An efficient multimedia support operation library, can be a variety of simple configuration operation photo, album, recording, recording and other functions.
Also support supporting the use of the display of pictures, video, audio 9 grid function.
- Part of the code for this open source library comes from Matisse.
- This open source library camera code from CameraView.
A non-X library version, no longer maintained(https://github.com/zhongjhATC/AlbumCameraRecorder/tree/master)
- Support for custom styles. Support to change the relevant buttons inside.
- Support album, recording, recording and other functions in one (similar to Douyin, etc.), and you can configure only one of the functions independently.
- Customizable permission requests are supported and can be directed to the library to complete permission requests
- While there are many features, some libraries can be introduced as required
- Rich callback interface and debugging information, using the existing API to achieve a rich effect.
- Strong compatibility, whether the lower version of 4.1 or the current latest version of Android 11, has been carried out related compatibility processing
- Support all image reading and processing customization, such as custom Glide, Fresco, etc
- Support to select pictures from albums
- Supports photo albums to select different folders according to mobile phone files
- Strong customization, support a variety of maximum selection of how many pictures, videos, and so on, also support only display custom file size
- Support custom album style, color, size and so on
- Support flash and front and rear camera switching when taking photos
- Support double finger touch to zoom in and out when recording and photographing, and single finger sliding up and down to control brightness
- recording, taking photos, pressing buttons, all of the UI is customizable, all SVG images are good for handling animation details
- Recording support for segment recording, video editing will be added in the future
- Image editing supports color graffiti, input text, Mosaic processing, rotation, cropping and other processing
- Support recording processing
- Deep compression is available for all recorded photos, custom compression is available for pictures, LuBan compression is available for Demo, and FFMPEG compression is available for videos
- Perfect cache management system
- Improved animation effects, which will be added later
- Performance optimizations, memory leaks -- all carefully addressed
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
dependencies {
// if you want to simplify the code and at the same time use multilibrary and progresslibrary, albumCameraRecorderCommon, can directly use the combined library
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:combined:1.1.29X'
// Public library, if not using the combined library above
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:albumCameraRecorderCommon:1.1.29X'
// core lib, call display album, screen recording, recording, etc
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:multilibrary:1.1.29X'
// It is mainly used to display the relevant upload progress after obtaining data. If you only need to obtain photos, videos and recordings, you don't need to use this
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:progresslibrary:1.1.29X'
// use it with editing pictures
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:imageedit:1.1.29X'
// For editing video
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:videoedit:1.1.29X'
}
100% throughCompatibility Test Report.
// Shooting Related Settings
CameraSetting cameraSetting = new CameraSetting();
// Types supported: picture, video
cameraSetting.mimeTypeSet(MimeType.ofAll());
// album
mAlbumSetting = new AlbumSetting(false)
// Types supported: picture, video
.mimeTypeSet(MimeType.ofAll())
// Whether to display the number of multiple selected images
.countable(true)
// Custom filter
.addFilter(new GifSizeFilter(320, 320, 5 * BaseFilter.K * BaseFilter.K))
// Open the original
.originalEnable(true)
// Maximum original size, valid only if originalEnable is true
.maxOriginalSize(10);
// recorder
RecorderSetting recorderSetting = new RecorderSetting();
// globalSetting
mGlobalSetting = MultiMediaSetting.from(MainSimpleActivity.this).choose(MimeType.ofAll());
if (mBinding.cbAlbum.isChecked()){
// Open the album function
mGlobalSetting.albumSetting(mAlbumSetting);
}
if (mBinding.cbCamera.isChecked()){
// Turn on the shooting function
mGlobalSetting.cameraSetting(cameraSetting);
}
if (mBinding.cbRecorder.isChecked()){
// Enable recording
mGlobalSetting.recorderSetting(recorderSetting);
}
mGlobalSetting
.setOnMainListener(errorMessage -> {
Log.d(TAG, errorMessage);
Toast.makeText(MainSimpleActivity.this.getApplicationContext(), errorMessage, Toast.LENGTH_LONG).show();
})
// Set paths and 7.0 protection paths, and so on
.allStrategy(new SaveStrategy(true, "com.zhongjh.cameraapp.fileprovider", "aabb"))
// for glide-V4
.imageEngine(new Glide4Engine())
// Maximum 5 images or maximum 3 video
.maxSelectablePerMediaType(null,
5,
3,
3,
alreadyImageCount,
alreadyVideoCount,
alreadyAudioCount)
.forResult(REQUEST_CODE_CHOOSE);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != RESULT_OK)
return;
switch (requestCode) {
case REQUEST_CODE_PREVIEW:
```
case REQUEST_CODE_CHOOSE:
// Gets the type and sets different things according to the type
switch (MultiMediaSetting.obtainMultimediaType(data)) {
case MultimediaTypes.PICTURE:
// picture
List<String> path = MultiMediaSetting.obtainResult(data);
break;
case MultimediaTypes.VIDEO:
// video
List<String> videoPath = MultiMediaSetting.obtainResult(data);
break;
case MultimediaTypes.AUDIO:
// voice
RecordingItem recordingItem = MultiMediaSetting.obtainRecordingItemResult(data);
break;
case MultimediaTypes.BLEND:
// Mixed type, which means the image may accompany the video.
List<Uri> blends = MultiMediaSetting.obtainResult(data);
break;
}
break;
}
}
If you need to use the data of the nine-grid exhibition, you can see A code for details.
- Call the multimedia public configuration API.
- Call the multimedia album configuration API.
- Call the recording configuration API for multimedia.
- Call the multimedia recording configuration API.
- Multimedia UI related properties configuration
- Multimedia related static methods
If you use the shown library, the following APIs are also useful for you
- Nine-grid related API.
- Nine-grid dependent Events.
- Nine-grid related properties, configuring the UI, etc
- The 1.1.29x version may be slightly different from the current latest code version Gitee download address