{"id":19633926,"url":"https://github.com/bilibili/boxing","last_synced_at":"2025-05-15T12:00:19.334Z","repository":{"id":46069188,"uuid":"79700448","full_name":"bilibili/boxing","owner":"bilibili","description":"Android multi-media selector based on MVP mode.","archived":false,"fork":false,"pushed_at":"2019-05-15T05:56:48.000Z","size":1603,"stargazers_count":3193,"open_issues_count":33,"forks_count":386,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-04-14T19:59:08.174Z","etag":null,"topics":["android","cinderella-man","compression","kotlin-android","media-picker","mvp","picture","video"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bilibili.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-22T07:04:34.000Z","updated_at":"2025-04-01T03:38:26.000Z","dependencies_parsed_at":"2022-09-11T08:41:27.277Z","dependency_job_id":null,"html_url":"https://github.com/bilibili/boxing","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilibili%2Fboxing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilibili%2Fboxing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilibili%2Fboxing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilibili%2Fboxing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bilibili","download_url":"https://codeload.github.com/bilibili/boxing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","cinderella-man","compression","kotlin-android","media-picker","mvp","picture","video"],"created_at":"2024-11-11T12:19:06.510Z","updated_at":"2025-05-15T12:00:19.143Z","avatar_url":"https://github.com/bilibili.png","language":"Java","readme":"## boxing\n---\nAndroid multi-media selector based on MVP mode.[中文文档](README_CN.md)  [![Build Status](https://travis-ci.org/Bilibili/boxing.svg?branch=master)](https://travis-ci.org/Bilibili/boxing)\n\n#### boxing Inside: \n[![bili](screenshot/bili.webp)](https://play.google.com/store/apps/details?id=tv.danmaku.bili)\n\n### Feature\n---\n- Custom UI\n- Multiple/single selection, preview and crop function\n- Gif support\n- Video selection\n- Image compression\n- Gif encode(checkout feature/gif-encode to have fun), see [Bilibili/BurstLinker](https://github.com/Bilibili/BurstLinker)\n\n### Download\n---\nCore version: only contain the core function.\n\nUI version: contain UI implements base on core version.\n\n- Maven\n\nCore version\n\n```xml\n\u003cdependency\u003e                       \n  \t\u003cgroupId\u003ecom.bilibili\u003c/groupId\u003e  \n  \t\u003cartifactId\u003eboxing\u003c/artifactId\u003e  \n  \t\u003cversion\u003e1.0.4\u003c/version\u003e\n  \t\u003ctype\u003epom\u003c/type\u003e                \n\u003c/dependency\u003e                      \t\t\n```\n\nUI version\n\n```xml\n\u003cdependency\u003e                          \n  \t\u003cgroupId\u003ecom.bilibili\u003c/groupId\u003e     \n  \t\u003cartifactId\u003eboxing-impl\u003c/artifactId\u003e\n  \t\u003cversion\u003e1.0.4\u003c/version\u003e\n  \t\u003ctype\u003epom\u003c/type\u003e                    \n\u003c/dependency\u003e                         \n```\n\n- Gradle\n\nCore version              \n```java\ncompile 'com.bilibili:boxing:1.0.4'\n```\n\nUI version\n```java\ncompile 'com.bilibili:boxing-impl:1.0.4'\n```\n\n### Preview\n\n![multi_image](screenshot/multi_image.webp)\n![single_image_crop](screenshot/single_image_crop.webp)\n![video](screenshot/video.webp)\n\n### Getting Started\n\n- Media loading initialization(required)\n```java\nBoxingMediaLoader.getInstance().init(new IBoxingMediaLoader()); // a class implements IBoxingMediaLoader \n```\n\n- Image cropping initialization(optional)\n```java\nBoxingCrop.getInstance().init(new IBoxingCrop());  // a class implements IBoxingCrop \n```\n- Build BoxingConfig\n  Specify the mode(Mode.SINGLE_IMG, Mode.MULTI_IMG, Mode.VIDEO) with camera and gif support. \n```java\nBoxingConfig config = new BoxingConfig(Mode); // Mode：Mode.SINGLE_IMG, Mode.MULTI_IMG, Mode.VIDEO\nconfig.needCamera(cameraRes).needGif().withMaxCount(9) // camera, gif support, set selected images count\n.withMediaPlaceHolderRes(resInt) // set the image placeholder, default 0\n.withAlbumPlaceHolderRes(resInt) // set the album placeholder, default 0\n.withVideoDurationRes(resInt) // set the video duration resource in video mode, default 0\n```\n- Get Boxing, set Intent and call start\n```java\n// start thumbnails Activity, need boxing-impl.\nBoxing.of(config).withIntent(context, BoxingActivity.class).start(callerActivity, REQUEST_CODE); \n  \t\n// start view raw image Activity, need boxing-impl.\nBoxing.of(config).withIntent(context, BoxingViewActivity.class).start(callerActivity, REQUEST_CODE); \n  \t\n// call of() use Mode.MULTI_IMG by default.\nBoxing.of().withIntent(context, class).start(callerActivity, REQUEST_CODE);\n```\n- Get Result\n```java\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n  \tList\u003cBaseMedia\u003e medias = Boxing.getResult(data);\n  \t// avoid null\n}\n```\n### Advanced usage\nMedia loading and image cropping initialization are the same as Simple Usage.\n\n- Customize Activity and Fragment\n  Extends AbsBoxingViewActivity and AbsBoxingViewFragment.\n  call `Boxing.of(config).withIntent(context, AbsBoxingViewActivity.class).start(callerActivity, REQUEST_CODE);` to start.\n\n- Only customize Fragment\n  Extends AbsBoxingViewFragment,no AbsBoxingViewActivity.\n  call `Boxing.of(BoxingConfig).setupFragment(AbsBoxingViewFragment, OnFinishListener);` to start.\n\n\n### FileProvider                                                                                   \nUse camera in Android N, add this in AndroidManifest.xml                                                        \n```xml\n\u003cprovider                                                 \n\tandroid:name=\"android.support.v4.content.FileProvider\"\n\tandroid:authorities=\"${applicationId}.file.provider\" \u003e               \n\t\u003cmeta-data                                            \n\t\tandroid:name=\"android.support.FILE_PROVIDER_PATHS\"\n\t\tandroid:resource=\"@xml/boxing_file_provider\"/\u003e\n\u003c/provider\u003e                 \n```\n\n### Kotlin Support\nStay hungry, stay foolish.\ncheckout `feature/kotlin` for fun.\n\n### TODO\nSupport different config at the same moment.\n\n### License\n----\nCopyright 2017 Bilibili\nLicensed 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\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\nUnless 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.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilibili%2Fboxing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbilibili%2Fboxing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilibili%2Fboxing/lists"}