### Add AlbumCameraRecorder Dependencies Source: https://github.com/zhongjhatc/albumcamerarecorder/blob/kotlin/README.md Include the desired AlbumCameraRecorder modules in your app's build.gradle file. Choose the combined library for a simplified setup or individual modules based on your needs. ```gradle dependencies { // If you want to simplify the code and use multilibrary, grid, and albumCameraRecorderCommon at the same implementation 'com.github.zhongjhATC.AlbumCameraRecorder:combined:2026' // Common library, if you don't use the combined library above implementation 'com.github.zhongjhATC.AlbumCameraRecorder:common:2026' // Core library for calling and displaying album, screen recording, audio recording, etc. implementation 'com.github.zhongjhATC.AlbumCameraRecorder:multilibrary:2026' // Used as a supplement, mainly for displaying relevant content after obtaining data and showing corresponding upload progress. If you only need to obtain data such as photos, videos, and audios, you don't need to use this. implementation 'com.github.zhongjhATC.AlbumCameraRecorder:grid:2026' // Used for image editing implementation 'com.github.zhongjhATC.AlbumCameraRecorder:imageedit:2026' // Used for video editing, currently only has compression function. More functions will be added later. Since this library uses ffmpeg, it takes up 25M of file size. Choose whether to use it according to the actual situation. implementation 'com.github.zhongjhATC.AlbumCameraRecorder:videoedit:2026' } ``` -------------------------------- ### Configure and Launch Multimedia Functions Source: https://github.com/zhongjhatc/albumcamerarecorder/blob/kotlin/README_EN.md Set up camera, album, and recorder settings, including MIME types, selection limits, and image engine. Use this to customize the multimedia selection experience. ```java // 拍摄有关设置 CameraSetting cameraSetting = new CameraSetting(); // 支持的类型:图片,视频 cameraSetting.mimeTypeSet(MimeType.ofAll()); // 相册 AlbumSetting albumSetting = new AlbumSetting(false) // 支持的类型:图片,视频 .mimeTypeSet(MimeType.ofAll()) // 是否显示多选图片的数字 .countable(true) // 自定义过滤器 .addFilter(new GifSizeFilter(320, 320, 5 * BaseFilter.K * BaseFilter.K)) // 开启原图 .originalEnable(true) // 最大原图size,仅当originalEnable为true的时候才有效 .maxOriginalSize(10); // 录音机 RecorderSetting recorderSetting = new RecorderSetting(); // 全局 mGlobalSetting = MultiMediaSetting.from(MainSimpleActivity.this).choose(MimeType.ofAll()); // 开启相册功能 mGlobalSetting.albumSetting(albumSetting); // 开启拍摄功能 mGlobalSetting.cameraSetting(cameraSetting); // 开启录音功能 mGlobalSetting.recorderSetting(recorderSetting); mGlobalSetting // for glide-V4 .imageEngine(new Glide4Engine()) // 最大5张图片、最大3个视频、最大1个音频。如果需要使用九宫格,请把九宫格GridView的maxCount也改动 mBinding.dmlImageList.setMaxMediaCount(); .maxSelectablePerMediaType(null, MAX_IMAGE_SELECTABLE, MAX_VIDEO_SELECTABLE, MAX_AUDIO_SELECTABLE, alreadyImageCount, alreadyVideoCount, alreadyAudioCount) .forResult(requestLauncherACR); ``` -------------------------------- ### Configure and Launch Multimedia Functions Source: https://github.com/zhongjhatc/albumcamerarecorder/blob/kotlin/README.md Set up camera, album, and recorder settings, including mime types, filters, and maximum selections. Use Glide for image loading. This snippet is used to initiate the multimedia selection process. ```java // 拍摄有关设置 CameraSetting cameraSetting = new CameraSetting(); // 支持的类型:图片,视频 cameraSetting.mimeTypeSet(MimeType.ofAll()); // 相册 AlbumSetting albumSetting = new AlbumSetting(false) // 支持的类型:图片,视频 .mimeTypeSet(MimeType.ofAll()) // 是否显示多选图片的数字 .countable(true) // 自定义过滤器 .addFilter(new GifSizeFilter(320, 320, 5 * BaseFilter.K * BaseFilter.K)) // 开启原图 .originalEnable(true) // 最大原图size,仅当originalEnable为true的时候才有效 .maxOriginalSize(10); // 录音机 RecorderSetting recorderSetting = new RecorderSetting(); // 全局 mGlobalSetting = MultiMediaSetting.from(MainSimpleActivity.this).choose(MimeType.ofAll()); // 开启相册功能 mGlobalSetting.albumSetting(albumSetting); // 开启拍摄功能 mGlobalSetting.cameraSetting(cameraSetting); // 开启录音功能 mGlobalSetting.recorderSetting(recorderSetting); mGlobalSetting // for glide-V4 .imageEngine(new Glide4Engine()) // 最大5张图片、最大3个视频、最大1个音频。如果需要使用九宫格,请把九宫格GridView的maxCount也改动 mBinding.dmlImageList.setMaxMediaCount(); .maxSelectablePerMediaType(null, MAX_IMAGE_SELECTABLE, MAX_VIDEO_SELECTABLE, MAX_AUDIO_SELECTABLE, alreadyImageCount, alreadyVideoCount, alreadyAudioCount) .forResult(requestLauncherACR); ``` -------------------------------- ### Handle Returned Multimedia Data Source: https://github.com/zhongjhatc/albumcamerarecorder/blob/kotlin/README_EN.md Register an ActivityResultLauncher to receive the selected media data. Ensure to check the result code and data before processing. ```java protected final ActivityResultLauncher requestLauncherACR = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> { if (result.getResultCode() != RESULT_OK) { return; } if (null == result.getData()) { return; } List data = MultiMediaSetting.obtainLocalMediaResult(result.getData()); printProperty(data); }); ``` -------------------------------- ### Handle Multimedia Selection Results Source: https://github.com/zhongjhatc/albumcamerarecorder/blob/kotlin/README.md Register an ActivityResultLauncher to receive and process the selected media data. This snippet demonstrates how to obtain the list of LocalMedia objects from the result intent. ```java protected final ActivityResultLauncher requestLauncherACR = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> { if (result.getResultCode() != RESULT_OK) { return; } if (null == result.getData()) { return; } List data = MultiMediaSetting.obtainLocalMediaResult(result.getData()); printProperty(data); }); ``` -------------------------------- ### Add JitPack Repository Source: https://github.com/zhongjhatc/albumcamerarecorder/blob/kotlin/README.md Add the JitPack repository to your project's build.gradle file to access the library. ```gradle allprojects { repositories { ... maven { url 'https://www.jitpack.io' } } } ``` -------------------------------- ### Configure Gradle for AndroidX Source: https://github.com/zhongjhatc/albumcamerarecorder/blob/kotlin/README.md Ensure Jetifier and AndroidX are enabled in your project's gradle.properties file for compatibility. ```properties android.enableJetifier=true android.useAndroidX=true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.