• Stars
    star
    3,193
  • Rank 14,059 (Top 0.3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android multi-media selector based on MVP mode.

boxing


Android multi-media selector based on MVP mode.中文文档 Build Status

boxing Inside:

bili

Feature


  • Custom UI
  • Multiple/single selection, preview and crop function
  • Gif support
  • Video selection
  • Image compression
  • Gif encode(checkout feature/gif-encode to have fun), see Bilibili/BurstLinker

Download


Core version: only contain the core function.

UI version: contain UI implements base on core version.

  • Maven

Core version

<dependency>                       
  	<groupId>com.bilibili</groupId>  
  	<artifactId>boxing</artifactId>  
  	<version>1.0.4</version>
  	<type>pom</type>                
</dependency>                      		

UI version

<dependency>                          
  	<groupId>com.bilibili</groupId>     
  	<artifactId>boxing-impl</artifactId>
  	<version>1.0.4</version>
  	<type>pom</type>                    
</dependency>                         
  • Gradle

Core version

compile 'com.bilibili:boxing:1.0.4'

UI version

compile 'com.bilibili:boxing-impl:1.0.4'

Preview

multi_image single_image_crop video

Getting Started

  • Media loading initialization(required)
BoxingMediaLoader.getInstance().init(new IBoxingMediaLoader()); // a class implements IBoxingMediaLoader 
  • Image cropping initialization(optional)
BoxingCrop.getInstance().init(new IBoxingCrop());  // a class implements IBoxingCrop 
  • Build BoxingConfig Specify the mode(Mode.SINGLE_IMG, Mode.MULTI_IMG, Mode.VIDEO) with camera and gif support.
BoxingConfig config = new BoxingConfig(Mode); // Mode:Mode.SINGLE_IMG, Mode.MULTI_IMG, Mode.VIDEO
config.needCamera(cameraRes).needGif().withMaxCount(9) // camera, gif support, set selected images count
.withMediaPlaceHolderRes(resInt) // set the image placeholder, default 0
.withAlbumPlaceHolderRes(resInt) // set the album placeholder, default 0
.withVideoDurationRes(resInt) // set the video duration resource in video mode, default 0
  • Get Boxing, set Intent and call start
// start thumbnails Activity, need boxing-impl.
Boxing.of(config).withIntent(context, BoxingActivity.class).start(callerActivity, REQUEST_CODE); 
  	
// start view raw image Activity, need boxing-impl.
Boxing.of(config).withIntent(context, BoxingViewActivity.class).start(callerActivity, REQUEST_CODE); 
  	
// call of() use Mode.MULTI_IMG by default.
Boxing.of().withIntent(context, class).start(callerActivity, REQUEST_CODE);
  • Get Result
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  	List<BaseMedia> medias = Boxing.getResult(data);
  	// avoid null
}

Advanced usage

Media loading and image cropping initialization are the same as Simple Usage.

  • Customize Activity and Fragment Extends AbsBoxingViewActivity and AbsBoxingViewFragment. call Boxing.of(config).withIntent(context, AbsBoxingViewActivity.class).start(callerActivity, REQUEST_CODE); to start.

  • Only customize Fragment Extends AbsBoxingViewFragment,no AbsBoxingViewActivity. call Boxing.of(BoxingConfig).setupFragment(AbsBoxingViewFragment, OnFinishListener); to start.

FileProvider

Use camera in Android N, add this in AndroidManifest.xml

<provider                                                 
	android:name="android.support.v4.content.FileProvider"
	android:authorities="${applicationId}.file.provider" >               
	<meta-data                                            
		android:name="android.support.FILE_PROVIDER_PATHS"
		android:resource="@xml/boxing_file_provider"/>
</provider>                 

Kotlin Support

Stay hungry, stay foolish. checkout feature/kotlin for fun.

TODO

Support different config at the same moment.

License


Copyright 2017 Bilibili 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.

More Repositories

1

ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
C
32,382
star
2

flv.js

HTML5 FLV Player
JavaScript
22,882
star
3

DanmakuFlameMaster

Android开源弹幕引擎·烈焰弹幕使 ~
Java
9,535
star
4

ailab

Python
5,588
star
5

MagicaSakura

MagicaSakura 是 Android 多主题框架。~ is an Android multi theme library which supporting both daily colorful theme and night theme.
Java
3,552
star
6

overlord

Overlord是哔哩哔哩基于Go语言编写的memcache和redis&cluster的代理及集群管理功能,致力于提供自动化高可用的缓存服务解决方案。
Go
2,213
star
7

gengine

Go
1,947
star
8

discovery

A registry for resilient mid-tier load balancing and failover.
Go
1,779
star
9

WebAV

WebAV is an SDK built on WebCodecs, designed for creating and editing video files on the web platform. WebAV 是基于 WebCodecs 构建的 SDK,用于在 Web 平台上创建/编辑视频文件。
TypeScript
895
star
10

Index-1.9B

A SOTA lightweight multilingual LLM
Python
877
star
11

vim-vide

Lightest vimrc, while strong enough. 最轻的vim配置,却足够强!
Vim Script
792
star
12

drawee-text-view

Simple drawee spannable text view based on Fresco
Java
762
star
13

join-us

大B站需要更多的小伙伴~ ( ゜- ゜)つロ 乾杯~
720
star
14

LastOrder-Dota2

Dota2 AI bot
Python
398
star
15

NativeBitmapFactory

DFM jni
C++
321
star
16

jni4android

JNI Generater for Android
C
309
star
17

BRouter

Kotlin
302
star
18

biliobs

C++
241
star
19

UnityBVA

C#
198
star
20

quiche

C++
198
star
21

bas

Bilibili Animation Script
HTML
187
star
22

kratos-demo

a project that use kratos
Go
187
star
23

libyuv

mirror of https://chromium.googlesource.com/external/libyuv/
C++
151
star
24

apk-channelization

[不支持v2签名]Android多渠道输出脚本
Python
147
star
25

BurstLinker

🚀 A simple GIF encoder for Android.
C++
140
star
26

xpref

A SharedPreferences' wrapper that truly supported sharing data across multi-process
Kotlin
84
star
27

soundtouch

SoundTouch library compiled for ijkplayer/Android http://www.surina.net/soundtouch/sourcecode.html
C++
84
star
28

mahimahi

C++
74
star
29

muzei-bilibili

Muzei 插件,bilibili 壁纸源
Java
72
star
30

vlc-android-macbuild

Deprecated, official site is recommended http://git.videolan.org
Java
70
star
31

redis_sdk_cxx

C++
65
star
32

LastOrder

StarCraft AI bot
C++
62
star
33

vlc-ports-android

fork of git://git.videolan.org/vlc-ports/android.git
C++
57
star
34

bbip

Bilibili High Performance IP Resolve Library
C++
55
star
35

oresty

Lua
52
star
36

SMGo

Shang-Mi cipher library. Constant-time implementation of SM2 and SM4.
Go
42
star
37

http-service

TypeScript
40
star
38

bilibili.github.io

35
star
39

adaptation

too painful to work with PagerAdapter
Java
32
star
40

vlc

fork of git://git.videolan.org/vlc.git
C
30
star
41

openssl

mirror of https://www.openssl.org
C
30
star
42

twirp

twirp rpc
Go
27
star
43

ci-ijk-ffmpeg-ios

Prebuilt FFmpeg for ijkplayer on iOS
Shell
17
star
44

abtest

A layered experiment framework for C++/java/go
15
star
45

gas-preprocessor

personal fork of git://git.libav.org/gas-preprocessor.git
Perl
13
star
46

flvbind

A tools to combine multiple flv file to a single flv file.
C
13
star
47

uptool

JavaScript
12
star
48

nginx_quic_module

C
12
star
49

nginx_quic_stack

C++
11
star
50

jmp_logpipe

A tool for jumper analyize log and send the command to remove UDP server for aduit. And this tool will denied for lszrz protocol to prevent a large log for storage.
C
11
star
51

ci-ijk-ffmpeg-android

Continuous integration for ijkplayer on Android
8
star
52

vim

B站Vim会所
5
star
53

arrange-play

Java
5
star
54

bilibili_wtm

Python
1
star