@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        createToolbar();
        findViewById(R.id.inside_bs_btn).setOnClickListener(this);
        mResultImg = (ImageView) findViewById(R.id.media_result);
        mResultImg.setOnClickListener(this);
        mInsideBottomSheet = (FrameLayout) findViewById(R.id.content_layout);
        BoxingBottomSheetFragment fragment = (BoxingBottomSheetFragment) getSupportFragmentManager().
                findFragmentByTag(BoxingBottomSheetFragment.TAG);
        if (fragment == null) {
            fragment = BoxingBottomSheetFragment.newInstance();
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.content_layout, fragment, BoxingBottomSheetFragment.TAG).commit();

            BoxingConfig singleImgConfig = new BoxingConfig(BoxingConfig.Mode.SINGLE_IMG)
                    .withMediaPlaceHolderRes(R.drawable.ic_boxing_default_image).withAlbumPlaceHolderRes(R.drawable.ic_boxing_default_image);
            Boxing.of(singleImgConfig).setupFragment(fragment, new Boxing.OnBoxingFinishListener() {

                @Override
                public void onBoxingFinish(Intent intent, List<BaseMedia> medias) {
                    BottomSheetBehavior behavior = BottomSheetBehavior.from(mInsideBottomSheet);
                    behavior.setState(BottomSheetBehavior.STATE_HIDDEN);
                    if (medias != null && medias.size() > 0) {
                        BaseMedia media = mMedia = medias.get(0);
                        String path = media.getPath();
                        BoxingMediaLoader.getInstance().displayRaw(mResultImg, path, 1080, 720, null);
                    }
                }
            });
        } else {
            fragment.setPresenter(new PickerPresenter(fragment));
        }
    }
to show use {@link AbsBoxingViewFragment} without {@link AbsBoxingActivity}.
use {@link Boxing#setupFragment(AbsBoxingViewFragment, Boxing.OnBoxingFinishListener)} to set a fragment.

@author ChenSL
app/src/main/java/com/bilibili/boxing/ui/SecondActivity.java